@vesviet/agent-skills 5.6.0 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INDEX.md +5 -5
- package/README.md +1 -1
- package/VERSION +1 -1
- package/adapters/antigravity/a2a-config.template.yaml +1 -1
- package/adapters/antigravity/role-skill-index.json +12 -12
- package/adapters/claude/CLAUDE_ADAPTER.md +1 -1
- package/adapters/cursor/README.md +185 -185
- package/bin/agent-skills.mjs +17 -14
- package/core/contracts/README.md +1 -1
- package/core/contracts/schemas/api-contract-spec.json +191 -191
- package/core/contracts/schemas/data-pipeline-spec.json +1 -1
- package/core/contracts/schemas/design-tokens-spec.json +19 -0
- package/core/contracts/schemas/feature-ticket.json +1293 -1293
- package/core/contracts/schemas/pull-request-spec.json +338 -338
- package/core/contracts/schemas/references/detailed/01-solution-and-governance.md +19 -19
- package/core/contracts/schemas/references/detailed/02-engineering-delivery.md +93 -93
- package/core/contracts/schemas/references/detailed/04-finance-accounting-and-compliance.md +54 -54
- package/core/contracts/schemas/references/detailed/05-design-and-content.md +92 -92
- package/core/contracts/schemas/references/detailed/06-seo-and-publishing.md +48 -48
- package/core/contracts/schemas/references/detailed/07-a2a-protocol.md +85 -85
- package/core/contracts/schemas/security-audit.json +143 -12
- package/core/contracts/schemas/system-design-spec.json +9 -1
- package/core/contracts/schemas/test-report.json +530 -530
- package/core/contracts/schemas/ux-flow-spec.json +66 -0
- package/core/roles/ai-systems-engineer.md +31 -18
- package/core/roles/aws-engineer.md +33 -29
- package/core/roles/backend-developer.md +6 -4
- package/core/roles/content-manager.md +7 -7
- package/core/roles/data-engineer.md +39 -36
- package/core/roles/qa-engineer.md +18 -18
- package/core/roles/references/ai-systems-engineer-review-checklist.md +11 -3
- package/core/roles/references/aws-engineer-review-checklist.md +29 -16
- package/core/roles/references/business-analyst-responsibilities.md +207 -207
- package/core/roles/references/content-manager-governance-standards.md +2 -2
- package/core/roles/references/content-manager-review-checklist.md +7 -1
- package/core/roles/references/data-engineer-review-checklist.md +11 -3
- package/core/roles/references/frontend-developer-responsibilities.md +275 -275
- package/core/roles/references/qa-engineer-review-checklist.md +10 -5
- package/core/roles/references/security-engineer-review-checklist.md +8 -0
- package/core/roles/references/solution-architect-review-checklist.md +6 -1
- package/core/roles/references/system-engineer-review-checklist.md +11 -0
- package/core/roles/references/ui-ux-designer-review-checklist.md +12 -0
- package/core/roles/security-engineer.md +35 -5
- package/core/roles/solution-architect.md +7 -7
- package/core/roles/system-engineer.md +470 -465
- package/core/roles/ui-ux-designer.md +17 -3
- package/core/skills/agent/agent-memory-compaction/references/anchored-schema-and-compaction-algorithms.md +141 -141
- package/core/skills/agent/architect-mcp-server/SKILL.md +3 -3
- package/core/skills/agent/decompose-agentic-system/SKILL.md +1 -1
- package/core/skills/ai/deploy-vllm-inference/SKILL.md +14 -14
- package/core/skills/ai-agent/agent-evaluation/SKILL.md +5 -0
- package/core/skills/ai-agent/context-optimization/SKILL.md +9 -0
- package/core/skills/backend/add-api-endpoint/SKILL.md +1 -0
- package/core/skills/backend/add-event-handler/SKILL.md +1 -0
- package/core/skills/backend/add-service-client/SKILL.md +1 -0
- package/core/skills/backend/build-mcp-server/SKILL.md +101 -100
- package/core/skills/backend/implement-auth/SKILL.md +1 -0
- package/core/skills/backend/implement-structured-outputs/SKILL.md +95 -94
- package/core/skills/backend/optimize-postgres/SKILL.md +1 -0
- package/core/skills/backend/scaffold-new-service/SKILL.md +1 -0
- package/core/skills/business/elicit-requirements/SKILL.md +102 -102
- package/core/skills/business/elicit-requirements/references/elicitation-techniques-and-babok-criteria.md +60 -60
- package/core/skills/business/trace-requirements-impact/SKILL.md +97 -97
- package/core/skills/business/trace-requirements-impact/references/rtm-graph-and-prioritization-models.md +109 -109
- package/core/skills/business/write-use-cases/SKILL.md +106 -106
- package/core/skills/business/write-use-cases/references/cockburn-scoping-and-13-field-template.md +135 -135
- package/core/skills/content/audit-content/SKILL.md +3 -2
- package/core/skills/content/audit-content/references/information-gain-rubric.md +1 -1
- package/core/skills/content/design-content-strategy/SKILL.md +6 -5
- package/core/skills/content/design-content-strategy/references/information-gain-and-decay-triage.md +2 -2
- package/core/skills/content/optimize-seo/SKILL.md +6 -5
- package/core/skills/content/optimize-seo/references/geo-ai-citation-playbook.md +2 -2
- package/core/skills/content/optimize-seo/references/process-and-checklist.md +1 -1
- package/core/skills/content/repurpose-content/SKILL.md +4 -3
- package/core/skills/content/write-article/SKILL.md +6 -5
- package/core/skills/content/write-copy/SKILL.md +3 -2
- package/core/skills/document/pptx/SKILL.md +1 -0
- package/core/skills/document/pptx/scripts/add_slide.py +0 -0
- package/core/skills/document/pptx/scripts/clean.py +0 -0
- package/core/skills/document/pptx/scripts/thumbnail.py +0 -0
- package/core/skills/document/xlsx/scripts/recalc.py +0 -0
- package/core/skills/documentation/write-documentation/SKILL.md +143 -143
- package/core/skills/documentation/write-tech-radar/SKILL.md +149 -149
- package/core/skills/foundation/accessibility-review/SKILL.md +160 -160
- package/core/skills/foundation/design-review/SKILL.md +11 -1
- package/core/skills/foundation/design-ux-flow/SKILL.md +13 -1
- package/core/skills/foundation/performance-profiling/SKILL.md +3 -1
- package/core/skills/foundation/release-notes/SKILL.md +192 -192
- package/core/skills/foundation/webapp-server-runner/scripts/with_server.py +0 -0
- package/core/skills/foundation/write-product-brief/SKILL.md +160 -160
- package/core/skills/foundation/write-tests/SKILL.md +11 -10
- package/core/skills/frontend/anti-ui-slop-finish-gate/SKILL.md +5 -0
- package/core/skills/frontend/design-md-specification/SKILL.md +1 -0
- package/core/skills/frontend/design-system-engineering/SKILL.md +4 -2
- package/core/skills/meetings-analysis/analyze-business-requirements/SKILL.md +1 -1
- package/core/skills/platform/add-telemetry-instrumentation/SKILL.md +2 -1
- package/core/skills/platform/aws-infrastructure/SKILL.md +12 -11
- package/core/skills/platform/cloudflare-email-service/SKILL.md +166 -166
- package/core/skills/platform/cloudflare-email-service/references/routing.md +199 -199
- package/core/skills/platform/debug-runtime-platform/SKILL.md +1 -0
- package/core/skills/platform/debug-workers-edge/SKILL.md +111 -111
- package/core/skills/platform/sandbox-sdk/SKILL.md +183 -183
- package/core/skills/platform/setup-gpu-finops/SKILL.md +111 -107
- package/core/skills/platform/setup-llm-gateway/SKILL.md +110 -108
- package/core/skills/platform/supply-chain-security/SKILL.md +1 -0
- package/core/skills/platform/system-design/SKILL.md +7 -0
- package/core/skills/platform/turnstile-spin/SKILL.md +118 -118
- package/core/skills/platform/turnstile-spin/scripts/auth-probe.sh +0 -0
- package/core/skills/platform/turnstile-spin/scripts/fetch-secret.sh +0 -0
- package/core/skills/platform/turnstile-spin/scripts/persist-skill.sh +0 -0
- package/core/skills/platform/turnstile-spin/scripts/validate.sh +0 -0
- package/core/skills/platform/turnstile-spin/scripts/widget-create.sh +0 -0
- package/core/skills/platform/turnstile-spin/scripts/worker-deploy.sh +0 -0
- package/core/skills/platform/turnstile-spin/templates/worker/src/index.ts +199 -199
- package/core/skills/platform/turnstile-spin/templates/worker/wrangler.toml +31 -31
- package/core/skills/platform/web-perf/SKILL.md +151 -151
- package/core/skills/platform/workers-best-practices/references/rules.md +463 -463
- package/core/skills/product/build-story-map/SKILL.md +104 -104
- package/core/skills/product/build-story-map/references/story-mapping-and-cpm-scheduling.md +101 -101
- package/core/skills/product/define-product-strategy/SKILL.md +105 -105
- package/core/skills/product/define-product-strategy/references/strategy-frameworks-and-pr-faq.md +142 -142
- package/core/skills/product/model-saas-metrics/SKILL.md +104 -104
- package/core/skills/product/model-saas-metrics/references/saas-unit-economics-and-pricing.md +110 -110
- package/core/skills/product/prioritize-roadmap/SKILL.md +106 -106
- package/core/skills/product/prioritize-roadmap/references/prioritization-scoring-and-kill-criteria.md +105 -105
- package/core/skills/repo-ops/commit-code/SKILL.md +190 -190
- package/core/skills/repo-ops/commit-code/references/multi-repo-and-deployment.md +21 -21
- package/core/skills/repo-ops/navigate-service/SKILL.md +199 -199
- package/core/skills/repo-ops/review-code/references/process-and-format.md +100 -100
- package/core/skills/repo-ops/review-service/SKILL.md +186 -186
- package/core/skills/repo-ops/troubleshoot-service/SKILL.md +127 -127
- package/core/skills/repo-ops/troubleshoot-service/references/failure-modes-and-security.md +22 -22
- package/core/skills/repo-ops/troubleshoot-service/references/suggested-process.md +110 -110
- package/core/skills/security-data/build-data-pipeline/SKILL.md +15 -14
- package/core/skills/security-data/build-data-pipeline/references/producer-contracts-and-lakehouse.md +5 -5
- package/core/skills/security-data/database-maintenance/SKILL.md +1 -0
- package/core/skills/security-data/database-maintenance/references/relational-and-vector-maintenance.md +5 -5
- package/core/skills/security-data/manage-secrets/SKILL.md +3 -0
- package/core/skills/security-data/optimize-olap-database/SKILL.md +14 -13
- package/core/skills/security-data/optimize-olap-database/references/olap-database-guide.md +2 -2
- package/core/skills/security-data/prompt-injection-defense/SKILL.md +3 -0
- package/core/skills/security-data/query-analytical-engine/SKILL.md +8 -7
- package/core/skills/security-data/query-analytical-engine/references/analytical-query-guide.md +3 -3
- package/core/skills/security-data/security-audit/SKILL.md +126 -119
- package/core/workflows/add-new-feature.md +212 -212
- package/core/workflows/agent-a2a-delegation.md +142 -142
- package/core/workflows/bug-fix.md +147 -147
- package/core/workflows/build-deploy.md +208 -208
- package/core/workflows/code-review.md +137 -137
- package/core/workflows/curriculum-delivery.md +1 -1
- package/core/workflows/dependency-upgrade.md +193 -193
- package/core/workflows/feature-delivery.md +149 -149
- package/core/workflows/hotfix-production.md +172 -172
- package/core/workflows/qa-validation.md +231 -231
- package/core/workflows/refactoring.md +154 -154
- package/core/workflows/revert-deployment.md +147 -147
- package/core/workflows/security-incident-response.md +191 -191
- package/core/workflows/seo-content-lifecycle.md +91 -91
- package/core/workflows/service-review-release.md +223 -223
- package/core/workflows/setup-new-service.md +214 -214
- package/core/workflows/tech-repo-review.md +245 -245
- package/core/workflows/troubleshooting.md +241 -241
- package/overlays/astro-cloudflare/README.md +93 -93
- package/overlays/data-analyst-stack/README.md +109 -109
- package/overlays/data-analyst-stack/rules/metric-dashboard-templates.md +135 -135
- package/overlays/data-analyst-stack/rules/stack-conventions.md +80 -80
- package/overlays/ecommerce-microservices/README.md +65 -65
- package/overlays/go-microservices/README.md +78 -78
- package/overlays/go-microservices/rules/go-conventions.md +223 -223
- package/overlays/laravel-filament/README.md +90 -90
- package/overlays/laravel-filament/rules/laravel-conventions.md +220 -220
- package/overlays/laravel-filament/skills/develop-laravel-feature/SKILL.md +141 -141
- package/overlays/laravel-filament/workflows/deploy-laravel.md +133 -133
- package/overlays/obj-configurator/rules/obj-project-rules.md +111 -111
- package/overlays/obj-configurator/skills/develop-obj-feature/SKILL.md +71 -71
- package/overlays/r3f-stack/README.md +89 -89
- package/overlays/r3f-stack/rules/stub.md +43 -43
- package/overlays/r3f-stack/skills/debug-3d-scene/SKILL.md +166 -166
- package/overlays/r3f-stack/skills/integrate-r3f-three-legacy/SKILL.md +159 -159
- package/overlays/r3f-stack/skills/optimize-3d-assets/SKILL.md +128 -128
- package/overlays/seo-publishing/rules/site-mix-and-cannibalization.md +52 -52
- package/overlays/ui-design-system/rules/handoff-conventions.md +73 -73
- package/package.json +2 -2
- package/core/README.md +0 -53
|
@@ -1,275 +1,275 @@
|
|
|
1
|
-
# frontend-developer.md - Year-Tagged Responsibilities (extracted)
|
|
2
|
-
|
|
3
|
-
These sections were extracted from `## Core Responsibilities` in the role file to keep the main file under a manageable size while preserving the full content.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
### AI-Generated UI Governance (2025-2026)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
In 2026, AI tools (Cursor, Copilot, v0) generate significant UI volume. The frontend developer's role shifts from writer to **architect, validator, and quality lead**:
|
|
11
|
-
|
|
12
|
-
**Tiered validation by risk level** — apply validation depth proportional to risk:
|
|
13
|
-
| Risk Tier | Example | Validation Required |
|
|
14
|
-
| --------- | ------- | ------------------- |
|
|
15
|
-
| **High** | Auth/permission UI, payment flows, form validation with business rules, role-conditional rendering | Full manual review: behavior correctness + accessibility + state machine correctness + security boundary check |
|
|
16
|
-
| **Medium** | Complex state flows, shared hooks/stores, API integration components | Review logic paths, all UI states, shared component impact |
|
|
17
|
-
| **Low** | Static layouts, presentational components, boilerplate scaffolding | Visual review + automated lint/a11y scan |
|
|
18
|
-
|
|
19
|
-
**Mandatory validation checklist for AI-generated UI code:**
|
|
20
|
-
- **Behavior correctness**: all UI states handled (loading, empty, error, disabled, stale, success); transitions are correct; derived state is computed correctly
|
|
21
|
-
- **Accessibility**: keyboard navigation, ARIA roles, focus management, screen reader compatibility; do not accept AI output that fails basic a11y checks
|
|
22
|
-
- **State management**: no unintended shared state mutations; no race conditions in async flows; optimistic updates have rollback paths
|
|
23
|
-
- **Rendering strategy**: SSR vs CSR vs partial hydration is intentional, not accidental; AI defaults may introduce unnecessary client-side JS or break SSR hydration
|
|
24
|
-
- **Security boundary**: UI permission checks are supplementary, not the primary security boundary; AI-generated role checks must not replace server-side authorization
|
|
25
|
-
- **Bundle impact**: check if AI-generated code added unnecessary dependencies or duplicated functionality already in the design system
|
|
26
|
-
|
|
27
|
-
**AI as collaborator, human as architect** — human engineer retains ownership of:
|
|
28
|
-
- rendering strategy selection: SSR / CSR / SSG / ISR / partial hydration / islands architecture
|
|
29
|
-
- state management boundaries: what is global state, what is local, what lives in the URL
|
|
30
|
-
- design system adherence: AI may not know your token system, component API, or naming conventions — verify
|
|
31
|
-
- performance budget decisions: AI-generated code may introduce bundle bloat that exceeds CI budget gates
|
|
32
|
-
|
|
33
|
-
**Visual regression testing** — for AI-generated UI changes:
|
|
34
|
-
- run visual diff against baseline screenshots for affected routes/components before merge
|
|
35
|
-
- use CI-integrated tools: **Playwright** (`toHaveScreenshot`), **Chromatic** (Storybook-based), or **Percy** for branch-diff visual comparison; baseline screenshots must be committed to the test repository
|
|
36
|
-
- flag unexpected layout shifts (CLS contributors) or rendering changes as defects, not style preferences
|
|
37
|
-
- treat visual regressions in auth flows, payment UI, or permission-conditional rendering as P1 blocking defects
|
|
38
|
-
|
|
39
|
-
**Agent Context Sharing (WebMCP):**
|
|
40
|
-
- implement Model Context Protocol (WebMCP) in the browser to share frontend state, DOM context, and UI events securely with autonomous AI Agents, allowing them to debug or interact with the client application natively
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
### AI Streaming UI & GenUI (2026)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
In 2026, AI-powered UIs stream token responses and structured UI components in real time. Frontend developers own the streaming consumption layer:
|
|
50
|
-
|
|
51
|
-
**SSE-based AI token streaming:**
|
|
52
|
-
- use **Server-Sent Events (SSE)** as the primary protocol for streaming AI token responses — SSE is native to HTTP, works with CDNs and load balancers, and supports auto-reconnect; avoid WebSockets for unidirectional AI response streaming
|
|
53
|
-
- wire an `AbortController` to every SSE/streaming fetch request; cancel the stream in `useEffect` cleanup or on navigation away — missing `AbortController` creates stuck loading states and wasted token spend
|
|
54
|
-
- expose a visible stop/cancel button wired to `AbortController.abort()` for any streaming request that the user may want to interrupt mid-generation
|
|
55
|
-
|
|
56
|
-
**INP-safe streaming renders:**
|
|
57
|
-
- **AI token streaming is the #1 new INP risk in 2026**: token-by-token DOM updates block the main thread and cause INP failures; chunk streaming renders with `scheduler.yield()` or `requestIdleCallback` to release the main thread between batches
|
|
58
|
-
- wrap non-urgent streaming updates in `React.startTransition` to deprioritize them behind user interactions
|
|
59
|
-
- pre-size AI response containers with CSS min-height or aspect-ratio to prevent streaming text causing Cumulative Layout Shift (CLS); never allow containers to grow unconstrained as tokens arrive
|
|
60
|
-
|
|
61
|
-
**GenUI (Generative UI via RSC streaming):**
|
|
62
|
-
- when using `streamUI` or equivalent (Vercel AI SDK), frontend devs must understand the RSC streaming lifecycle: the server streams hydrated React components (not just text tokens), requiring correct Suspense boundary placement and streaming-compatible layout
|
|
63
|
-
- do not allow agents to stream arbitrary JSX or HTML — use the Component Registry pattern (see below) to ensure only pre-approved, type-safe components are rendered
|
|
64
|
-
|
|
65
|
-
**AG-UI event rendering:**
|
|
66
|
-
- for agentic pipelines using the AG-UI protocol, implement discrete UI states for each event type: `THOUGHT` (show thinking indicator), `TOOL_CALL` (show tool execution progress), `RESULT` (render structured output), `ERROR` (show error state with retry option)
|
|
67
|
-
- do not render AG-UI events as raw text; each event type maps to a specific UI component with defined visual treatment
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
### AI Disclosure & Agent-Safe Components (2026)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
EU AI Act Article 50 is live from **2 August 2026**. Frontend developers are the implementation layer for legal disclosure compliance:
|
|
77
|
-
|
|
78
|
-
**Article 50 disclosure UI (legal requirement):**
|
|
79
|
-
- every AI-powered feature that interacts with natural persons must display a clear, accessible, non-dismissable disclosure **before or during the first meaningful interaction** — not after the first AI message
|
|
80
|
-
- the disclosure must use plain, unambiguous language: "You are interacting with an AI system" — must not be buried in terms, tooltips, or sub-menus
|
|
81
|
-
- build a reusable `<AIDisclosureBanner>` component with the EU-approved AI icon for AI-generated content labels; use this component consistently across all AI-powered features — do not recreate disclosure UI per feature
|
|
82
|
-
- for systems live before 2 August 2026: machine-readable marking (C2PA content credentials or equivalent) for AI-generated images, audio, and video must be implemented by **2 December 2026**; include this as a scheduled engineering item in scope planning
|
|
83
|
-
|
|
84
|
-
**AI-generated content marking:**
|
|
85
|
-
- embed `data-ai-generated="true"` attributes on all AI-rendered text containers for machine-readable marking
|
|
86
|
-
- for AI-generated media (images, audio, video): integrate C2PA (Coalition for Content Provenance and Authenticity) content credentials or equivalent technical watermark metadata
|
|
87
|
-
- the EU AI icon must accompany any labelled AI-generated content display in EU-market products
|
|
88
|
-
|
|
89
|
-
**Agent-safe Component Registry pattern:**
|
|
90
|
-
- never allow AI agents to generate arbitrary JSX, HTML strings, or raw component trees for direct rendering; this is a critical security and quality boundary
|
|
91
|
-
- implement a typed Component Registry: agent sends structured JSON (`{ "type": "invoice", "props": {...} }`), the registry maps the type to a pre-approved, security-reviewed React component that renders the trusted UI
|
|
92
|
-
- all components in the registry must pass full security and accessibility review before registration; the registry is the trust boundary, not the agent
|
|
93
|
-
|
|
94
|
-
**HITL approval gates:**
|
|
95
|
-
- all agent-triggered mutations (payments, data deletion, form submission, external communications) must require an explicit `<AgentActionApprovalModal>` before execution — never allow agents to trigger irreversible actions without user confirmation
|
|
96
|
-
- wire HITL approval modals to `AbortController`; if the user cancels, abort the agent action and return to safe state
|
|
97
|
-
- the HITL gate must be rendered as a visible, keyboard-accessible modal — not a background confirmation; screen readers must announce the approval request
|
|
98
|
-
|
|
99
|
-
**Calling AI APIs — always via backend proxy:**
|
|
100
|
-
- never call AI provider APIs (OpenAI, Anthropic, Gemini) directly from frontend code; API keys must never be in browser-accessible code
|
|
101
|
-
- all LLM calls must route through a backend proxy layer that owns: API key management, rate limiting, cost attribution, token logging, and response caching
|
|
102
|
-
- the frontend consumes the proxy API via SSE or standard REST — it has no knowledge of which AI provider is used or what system prompt is sent
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
---
|
|
107
|
-
|
|
108
|
-
### WCAG 2.2 AA Legal Compliance (2026)
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
WCAG 2.2 AA is the mandatory legal baseline under EU EN 301 549, the UK Equality Act 2010, and ADA/Section 508. Frontend developers must implement all 9 new success criteria introduced in WCAG 2.2:
|
|
112
|
-
|
|
113
|
-
**WCAG 2.2 AA — new criteria (legally required):**
|
|
114
|
-
| Criterion | Level | Frontend Implementation |
|
|
115
|
-
|-----------|-------|------------------------|
|
|
116
|
-
| **2.4.11 Focus Not Obscured (Minimum)** | AA | Sticky headers, footers, overlays, and chat widgets must not fully cover a focused element; use scroll-margin-top / scroll-padding CSS properties on focusable elements beneath fixed bars |
|
|
117
|
-
| **2.5.7 Dragging Movements** | AA | All drag-and-drop interactions must have a single-pointer (click/tap) alternative — buttons to move, reorder, or resize items |
|
|
118
|
-
| **2.5.8 Target Size (Minimum)** | AA | Interactive targets must be ≥ 24×24 CSS pixels, or have sufficient spacing; critical for AI chat input areas, send buttons, and action chips |
|
|
119
|
-
| **3.2.6 Consistent Help** | A | Help mechanisms (support chat, FAQ links, contact) must appear in the same relative location across all pages in the site |
|
|
120
|
-
| **3.3.7 Redundant Entry** | A | Auto-populate previously entered data in multi-step flows; do not force users to re-enter information already provided in the same session |
|
|
121
|
-
| **3.3.8 Accessible Authentication (Minimum)** | AA | Authentication must not rely on cognitive function tests (puzzles, memorization, image recognition); directly impacts CAPTCHA choice — Turnstile (Cloudflare) or audio CAPTCHA is compliant; standard image CAPTCHAs are not |
|
|
122
|
-
|
|
123
|
-
**WCAG 2.2 for AI-powered UIs specifically:**
|
|
124
|
-
- **`aria-live="polite"` on streaming containers** is mandatory: screen readers cannot announce streaming AI tokens without an aria-live region; add `role="log"` + `aria-live="polite"` to all AI response containers
|
|
125
|
-
- **focus management after agent actions**: when an agent modifies the DOM, move focus to a meaningful element (e.g., the newly rendered result or a status notification); do not leave focus on a trigger element that no longer reflects current state
|
|
126
|
-
- **AI-generated content must be accessible**: validate any AI-generated HTML markup with axe-core before DOM insertion; AI tools frequently generate inaccessible markup (missing alt attributes, missing labels, incorrect ARIA roles)
|
|
127
|
-
- **WCAG 3.0** is in working draft — not yet required, but monitor for the new scoring model; design system tokens and component patterns adopted now will ease the transition
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
### Performance-as-a-Product (2025-2026)
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
Performance is a direct revenue driver. A 100ms improvement in response time can increase conversion by 1%; a poor INP score degrades perceived quality for all users. Enforce this at the engineering level:
|
|
137
|
-
|
|
138
|
-
**Core Web Vitals (CWV) — the 2026 standards:**
|
|
139
|
-
| Metric | What it measures | Target |
|
|
140
|
-
| ------ | ---------------- | ------ |
|
|
141
|
-
| **INP** (Interaction to Next Paint) | Overall session responsiveness (replaced FID in 2024) | <200ms |
|
|
142
|
-
| **LCP** (Largest Contentful Paint) | Perceived load speed | <2.5s |
|
|
143
|
-
| **CLS** (Cumulative Layout Shift) | Visual stability | <0.1 |
|
|
144
|
-
|
|
145
|
-
- **INP is the definitive responsiveness metric** in 2026: it measures every interaction throughout the session, not just the first (FID). A page that loads fast but stutters on interactions will still fail CWV.
|
|
146
|
-
- prioritize **field data (CrUX)** over lab data (Lighthouse scores): a 100/100 Lighthouse score on a fast dev machine does not represent real users on slow devices or mobile networks
|
|
147
|
-
|
|
148
|
-
**Performance budgets in CI/CD:**
|
|
149
|
-
- define and enforce JS bundle size budgets per route; fail CI if a change causes a bundle to exceed the budget
|
|
150
|
-
- define CWV budgets per page type and integrate CWV regression detection in CI (Lighthouse CI or equivalent)
|
|
151
|
-
- treat a CWV budget breach as a blocking defect, not a polish item
|
|
152
|
-
|
|
153
|
-
**Rendering strategy decision framework** — choose intentionally for each route:
|
|
154
|
-
| Strategy | Use when | Performance profile |
|
|
155
|
-
| -------- | -------- | ------------------- |
|
|
156
|
-
| **SSG** (Static Site Generation) | Content rarely changes, no user personalization | Fastest: CDN-cached HTML |
|
|
157
|
-
| **SSR** (Server-Side Rendering) | Personalized or frequently updated content | Fast TTFB, full HTML for SEO |
|
|
158
|
-
| **ISR** (Incremental Static Regeneration) | Content changes on a schedule | CDN cache + background revalidation |
|
|
159
|
-
| **CSR** (Client-Side Rendering) | Highly interactive, auth-gated dashboards | Worst for initial load; acceptable for app-shell after hydration |
|
|
160
|
-
| **Partial hydration / Islands** | Content-heavy pages with isolated interactive islands | Minimal JS: only interactive components hydrate |
|
|
161
|
-
|
|
162
|
-
**Optimization tactics for INP:**
|
|
163
|
-
- **break up long tasks**: any JS task >50ms on the main thread delays interaction response; use `scheduler.yield()` or task chunking
|
|
164
|
-
- **defer non-essential third-party scripts**: analytics, chat widgets, and ad scripts must not block interaction readiness
|
|
165
|
-
- **prioritize LCP elements**: use `fetchpriority="high"` on above-the-fold images and critical resources
|
|
166
|
-
- **adaptive hydration**: prioritize hydrating components based on user viewport position and device capability, not page order
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
---
|
|
171
|
-
|
|
172
|
-
### Accessibility-as-CI-Gate (2025-2026)
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
Accessibility review as a manual, pre-merge concern is insufficient at 2026 delivery pace. The production standard is **automated a11y enforcement baked into CI as a hard quality gate**, blocking merge on regression rather than relying on manual checklists:
|
|
176
|
-
|
|
177
|
-
**axe-core CI enforcement (hard gate):**
|
|
178
|
-
- integrate `@axe-core/playwright` into the CI test suite; run a11y scans on every PR against all affected routes and component states
|
|
179
|
-
- configure CI to **fail the build** on any new axe-core violation (do not allow existing violations to suppress new ones via a blanket ignore list; use targeted `rules: { 'rule-id': { enabled: false } }` for known exceptions with documented rationale)
|
|
180
|
-
- scan all user-facing states: not only the happy path render; include empty states, error states, and permission-limited states in the scan scope
|
|
181
|
-
- treat axe-core scan failures as P1 blocking defects, not style preferences; inaccessible controls are a legal liability under WCAG 2.2 AA (required by EU EN 301 549, ADA, and Section 508)
|
|
182
|
-
|
|
183
|
-
**Lighthouse CI continuous a11y tracking:**
|
|
184
|
-
- configure Lighthouse CI to track the Accessibility score alongside CWV metrics on every PR; publish score trends in the CI report
|
|
185
|
-
- set a minimum Lighthouse Accessibility score budget (e.g., 95+); score drops below budget trigger the same review process as CWV budget breaches
|
|
186
|
-
- use Lighthouse CI historical comparison to catch gradual score erosion across many small PRs that individually pass the axe-core hard gate
|
|
187
|
-
|
|
188
|
-
**A11Y enforcement in AI-generated UI:**
|
|
189
|
-
- AI tools (Cursor, Copilot, v0) frequently omit ARIA roles, focus management, and keyboard navigation; the axe-core CI gate catches these automatically
|
|
190
|
-
- for High-tier AI-generated UI (auth, payment, permission-conditional rendering): manual a11y review remains mandatory in addition to the automated gate
|
|
191
|
-
- the axe-core CI gate does not replace manual testing with VoiceOver/NVDA/JAWS for complex interactive components; it catches the systematic, automatable failures
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
---
|
|
196
|
-
|
|
197
|
-
### Edge-Side Rendering — React Server Components at CDN Edge (2025-2026)
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
The rendering strategy table covers SSR/CSR/SSG/ISR/Islands. A new architectural option in 2026 is **React Server Components (RSC) executing directly on the CDN edge** (Cloudflare Workers + Vite Cloudflare plugin), which is architecturally distinct from origin-server SSR and changes the performance profile and constraint set:
|
|
201
|
-
|
|
202
|
-
**Edge RSC vs. origin SSR — key distinctions:**
|
|
203
|
-
| Dimension | Origin SSR | Edge RSC (Cloudflare Workers) |
|
|
204
|
-
|-----------|-----------|-------------------------------|
|
|
205
|
-
| **TTFB** | 50–200ms typical (origin round-trip) | Near-zero (executed at nearest PoP) |
|
|
206
|
-
| **Runtime** | Node.js (full API) | V8 isolate (no Node.js APIs, no filesystem, no native modules) |
|
|
207
|
-
| **Streaming** | Node.js `ReadableStream` | `TransformStream` (Web Streams API only) |
|
|
208
|
-
| **State** | In-memory / Redis | Durable Objects (stateful coordination at edge) |
|
|
209
|
-
| **Cold starts** | Container warm-up (100ms–1s) | Isolate cold start (<5ms) |
|
|
210
|
-
| **Cost** | Per-second compute | Per-request microsecond billing |
|
|
211
|
-
|
|
212
|
-
**Edge-compatibility constraints — must validate before deploying RSC to edge:**
|
|
213
|
-
- **No Node.js APIs**: "fs", "path", "crypto" (Node version), "child_process", "Buffer" (non-Web), and any npm package that wraps them will fail at the edge; use Web APIs equivalents (`crypto.subtle`, `TextEncoder`, `URL`)
|
|
214
|
-
- **No native Node modules** (`.node` binaries): any npm package with native bindings cannot run in a V8 isolate; audit all RSC dependencies with `wrangler types` or the CF compatibility checker
|
|
215
|
-
- **Streaming is TransformStream-based**: RSC streaming uses Web Streams; libraries that pipe via Node.js "stream" require adaptation
|
|
216
|
-
- **Durable Objects for stateful edge**: if RSC needs per-user session state at the edge, use Durable Objects (WebSocket hibernation for long-lived connections); do not attempt to hold state in V8 isolate memory across requests
|
|
217
|
-
- **Bundle size limit**: Cloudflare Workers have a 10MB (compressed) script limit; monitor RSC bundle size; code splitting is required for large component trees
|
|
218
|
-
|
|
219
|
-
**When to choose Edge RSC over origin SSR:**
|
|
220
|
-
- choose Edge RSC when: TTFB is the primary bottleneck, the route has no Node.js-specific dependencies, personalization data is available at the edge (via KV, D1, or Durable Objects), and the component tree is within bundle limits
|
|
221
|
-
- choose origin SSR when: the route requires Node.js APIs, uses native npm modules, or needs large database queries that benefit from origin proximity
|
|
222
|
-
- **EDGE-RENDERING-COMPAT LOCK** applies: the decision to deploy RSC to the edge is an architectural choice that must be validated, not an automatic optimization
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
### PWA-Agent Bridge — Service Workers as Agentic Control-Plane (2025-2026)
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
In 2026, Service Workers are evolving beyond caching and offline support into **agentic orchestration infrastructure**: managing background AI task delegation, polling agent status, and bridging AI task completion back to the user interface:
|
|
232
|
-
|
|
233
|
-
**Service Worker as agentic control-plane:**
|
|
234
|
-
- use Service Workers to orchestrate background AI task delegation: the SW intercepts fetch requests to AI endpoints, queues tasks when offline, and retries with exponential backoff using `Periodic Background Sync`
|
|
235
|
-
- `Background Sync API`: when the device regains connectivity, the SW automatically retries queued AI tasks without requiring the user to re-submit; critical for mobile users on unreliable connections
|
|
236
|
-
- `Periodic Background Sync API`: for agent check-in patterns where the app periodically polls for completed agent tasks, updates, or model refreshes without requiring the user to open the app
|
|
237
|
-
|
|
238
|
-
**Web Push API as HITL callback bridge:**
|
|
239
|
-
- for Human-in-the-Loop AI workflows (agent tasks that require user approval or input), use the `Push API` to deliver HITL notifications: the backend sends a push event when the agent reaches a decision point requiring user input
|
|
240
|
-
- the Service Worker receives the push event and shows a notification (even when the app is closed); the user taps to open the app and complete the HITL step
|
|
241
|
-
- this enables truly async agentic workflows: the user initiates a task, the agent works in the background, and the push notification bridges the HITL callback
|
|
242
|
-
|
|
243
|
-
**Service Worker scope and security constraints:**
|
|
244
|
-
- Service Workers must not execute LLM inference directly; inference must be delegated to cloud AI agents or native app layers; the SW is a control-plane, not a compute engine
|
|
245
|
-
- validate message origin for all `postMessage` communication between SW and the app; do not process messages from untrusted origins
|
|
246
|
-
- Service Worker registration scope limits which routes the SW controls; scope must be declared explicitly and reviewed for overly broad coverage
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
---
|
|
251
|
-
|
|
252
|
-
### Browser-Native Module Federation (2025-2026)
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
For micro-frontend architectures or large frontend applications with independent team delivery, 2026 introduces a production-viable alternative to Webpack Module Federation: **Import Maps + ESM (Browser-Native Federation)**:
|
|
256
|
-
|
|
257
|
-
**Import Maps (<script type="importmap">):**
|
|
258
|
-
- Import Maps are a W3C standard (~94.5% browser coverage in 2026, with es-module-shims for compatibility fallback); they allow remapping bare module specifiers to URLs at the browser level without a bundler
|
|
259
|
-
- use Import Maps to share singleton dependencies (React, a design system library) across independently deployed micro-frontends without bundler coordination; each micro-frontend declares its own modules, and the Import Map enforces shared singleton versions
|
|
260
|
-
- Import Maps are a static JSON declaration served with the HTML shell; updates to the map require an HTML shell deployment, not a library rebuild
|
|
261
|
-
|
|
262
|
-
**Native Federation decision framework — when to use which approach:**
|
|
263
|
-
| Approach | Use when |
|
|
264
|
-
|----------|----------|
|
|
265
|
-
| **Import Maps + ESM** | Small to medium micro-frontend teams; bundler-agnostic requirement; singleton enforcement is the primary concern; no complex shared state across micro-frontends |
|
|
266
|
-
| **Module Federation 2.0** (Webpack/Rspack) | Large teams with complex dynamic loading requirements; runtime feature flags for shared modules; need for runtime version negotiation between independently deployed apps |
|
|
267
|
-
| **Single bundled app** | Team size <5 FE engineers; feature velocity over deployment independence; complexity cost of federation exceeds the benefit |
|
|
268
|
-
|
|
269
|
-
**Singleton management with Import Maps:**
|
|
270
|
-
- the primary risk of module federation (any approach) is **duplicate framework instances** (two React copies in the same page); this causes silent failures (hooks state isolation, context disappearing, event system splits)
|
|
271
|
-
- in Import Maps: pin React, ReactDOM, and all shared singletons in the Import Map with exact version URLs; micro-frontends must not bundle their own copy of pinned singletons
|
|
272
|
-
- verify singleton enforcement at runtime with `window.__REACT_DEVTOOLS_GLOBAL_HOOK__` or equivalent; if two React instances are present, the Import Map has a gap
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
---
|
|
1
|
+
# frontend-developer.md - Year-Tagged Responsibilities (extracted)
|
|
2
|
+
|
|
3
|
+
These sections were extracted from `## Core Responsibilities` in the role file to keep the main file under a manageable size while preserving the full content.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### AI-Generated UI Governance (2025-2026)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
In 2026, AI tools (Cursor, Copilot, v0) generate significant UI volume. The frontend developer's role shifts from writer to **architect, validator, and quality lead**:
|
|
11
|
+
|
|
12
|
+
**Tiered validation by risk level** — apply validation depth proportional to risk:
|
|
13
|
+
| Risk Tier | Example | Validation Required |
|
|
14
|
+
| --------- | ------- | ------------------- |
|
|
15
|
+
| **High** | Auth/permission UI, payment flows, form validation with business rules, role-conditional rendering | Full manual review: behavior correctness + accessibility + state machine correctness + security boundary check |
|
|
16
|
+
| **Medium** | Complex state flows, shared hooks/stores, API integration components | Review logic paths, all UI states, shared component impact |
|
|
17
|
+
| **Low** | Static layouts, presentational components, boilerplate scaffolding | Visual review + automated lint/a11y scan |
|
|
18
|
+
|
|
19
|
+
**Mandatory validation checklist for AI-generated UI code:**
|
|
20
|
+
- **Behavior correctness**: all UI states handled (loading, empty, error, disabled, stale, success); transitions are correct; derived state is computed correctly
|
|
21
|
+
- **Accessibility**: keyboard navigation, ARIA roles, focus management, screen reader compatibility; do not accept AI output that fails basic a11y checks
|
|
22
|
+
- **State management**: no unintended shared state mutations; no race conditions in async flows; optimistic updates have rollback paths
|
|
23
|
+
- **Rendering strategy**: SSR vs CSR vs partial hydration is intentional, not accidental; AI defaults may introduce unnecessary client-side JS or break SSR hydration
|
|
24
|
+
- **Security boundary**: UI permission checks are supplementary, not the primary security boundary; AI-generated role checks must not replace server-side authorization
|
|
25
|
+
- **Bundle impact**: check if AI-generated code added unnecessary dependencies or duplicated functionality already in the design system
|
|
26
|
+
|
|
27
|
+
**AI as collaborator, human as architect** — human engineer retains ownership of:
|
|
28
|
+
- rendering strategy selection: SSR / CSR / SSG / ISR / partial hydration / islands architecture
|
|
29
|
+
- state management boundaries: what is global state, what is local, what lives in the URL
|
|
30
|
+
- design system adherence: AI may not know your token system, component API, or naming conventions — verify
|
|
31
|
+
- performance budget decisions: AI-generated code may introduce bundle bloat that exceeds CI budget gates
|
|
32
|
+
|
|
33
|
+
**Visual regression testing** — for AI-generated UI changes:
|
|
34
|
+
- run visual diff against baseline screenshots for affected routes/components before merge
|
|
35
|
+
- use CI-integrated tools: **Playwright** (`toHaveScreenshot`), **Chromatic** (Storybook-based), or **Percy** for branch-diff visual comparison; baseline screenshots must be committed to the test repository
|
|
36
|
+
- flag unexpected layout shifts (CLS contributors) or rendering changes as defects, not style preferences
|
|
37
|
+
- treat visual regressions in auth flows, payment UI, or permission-conditional rendering as P1 blocking defects
|
|
38
|
+
|
|
39
|
+
**Agent Context Sharing (WebMCP):**
|
|
40
|
+
- implement Model Context Protocol (WebMCP) in the browser to share frontend state, DOM context, and UI events securely with autonomous AI Agents, allowing them to debug or interact with the client application natively
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
### AI Streaming UI & GenUI (2026)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
In 2026, AI-powered UIs stream token responses and structured UI components in real time. Frontend developers own the streaming consumption layer:
|
|
50
|
+
|
|
51
|
+
**SSE-based AI token streaming:**
|
|
52
|
+
- use **Server-Sent Events (SSE)** as the primary protocol for streaming AI token responses — SSE is native to HTTP, works with CDNs and load balancers, and supports auto-reconnect; avoid WebSockets for unidirectional AI response streaming
|
|
53
|
+
- wire an `AbortController` to every SSE/streaming fetch request; cancel the stream in `useEffect` cleanup or on navigation away — missing `AbortController` creates stuck loading states and wasted token spend
|
|
54
|
+
- expose a visible stop/cancel button wired to `AbortController.abort()` for any streaming request that the user may want to interrupt mid-generation
|
|
55
|
+
|
|
56
|
+
**INP-safe streaming renders:**
|
|
57
|
+
- **AI token streaming is the #1 new INP risk in 2026**: token-by-token DOM updates block the main thread and cause INP failures; chunk streaming renders with `scheduler.yield()` or `requestIdleCallback` to release the main thread between batches
|
|
58
|
+
- wrap non-urgent streaming updates in `React.startTransition` to deprioritize them behind user interactions
|
|
59
|
+
- pre-size AI response containers with CSS min-height or aspect-ratio to prevent streaming text causing Cumulative Layout Shift (CLS); never allow containers to grow unconstrained as tokens arrive
|
|
60
|
+
|
|
61
|
+
**GenUI (Generative UI via RSC streaming):**
|
|
62
|
+
- when using `streamUI` or equivalent (Vercel AI SDK), frontend devs must understand the RSC streaming lifecycle: the server streams hydrated React components (not just text tokens), requiring correct Suspense boundary placement and streaming-compatible layout
|
|
63
|
+
- do not allow agents to stream arbitrary JSX or HTML — use the Component Registry pattern (see below) to ensure only pre-approved, type-safe components are rendered
|
|
64
|
+
|
|
65
|
+
**AG-UI event rendering:**
|
|
66
|
+
- for agentic pipelines using the AG-UI protocol, implement discrete UI states for each event type: `THOUGHT` (show thinking indicator), `TOOL_CALL` (show tool execution progress), `RESULT` (render structured output), `ERROR` (show error state with retry option)
|
|
67
|
+
- do not render AG-UI events as raw text; each event type maps to a specific UI component with defined visual treatment
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
### AI Disclosure & Agent-Safe Components (2026)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
EU AI Act Article 50 is live from **2 August 2026**. Frontend developers are the implementation layer for legal disclosure compliance:
|
|
77
|
+
|
|
78
|
+
**Article 50 disclosure UI (legal requirement):**
|
|
79
|
+
- every AI-powered feature that interacts with natural persons must display a clear, accessible, non-dismissable disclosure **before or during the first meaningful interaction** — not after the first AI message
|
|
80
|
+
- the disclosure must use plain, unambiguous language: "You are interacting with an AI system" — must not be buried in terms, tooltips, or sub-menus
|
|
81
|
+
- build a reusable `<AIDisclosureBanner>` component with the EU-approved AI icon for AI-generated content labels; use this component consistently across all AI-powered features — do not recreate disclosure UI per feature
|
|
82
|
+
- for systems live before 2 August 2026: machine-readable marking (C2PA content credentials or equivalent) for AI-generated images, audio, and video must be implemented by **2 December 2026**; include this as a scheduled engineering item in scope planning
|
|
83
|
+
|
|
84
|
+
**AI-generated content marking:**
|
|
85
|
+
- embed `data-ai-generated="true"` attributes on all AI-rendered text containers for machine-readable marking
|
|
86
|
+
- for AI-generated media (images, audio, video): integrate C2PA (Coalition for Content Provenance and Authenticity) content credentials or equivalent technical watermark metadata
|
|
87
|
+
- the EU AI icon must accompany any labelled AI-generated content display in EU-market products
|
|
88
|
+
|
|
89
|
+
**Agent-safe Component Registry pattern:**
|
|
90
|
+
- never allow AI agents to generate arbitrary JSX, HTML strings, or raw component trees for direct rendering; this is a critical security and quality boundary
|
|
91
|
+
- implement a typed Component Registry: agent sends structured JSON (`{ "type": "invoice", "props": {...} }`), the registry maps the type to a pre-approved, security-reviewed React component that renders the trusted UI
|
|
92
|
+
- all components in the registry must pass full security and accessibility review before registration; the registry is the trust boundary, not the agent
|
|
93
|
+
|
|
94
|
+
**HITL approval gates:**
|
|
95
|
+
- all agent-triggered mutations (payments, data deletion, form submission, external communications) must require an explicit `<AgentActionApprovalModal>` before execution — never allow agents to trigger irreversible actions without user confirmation
|
|
96
|
+
- wire HITL approval modals to `AbortController`; if the user cancels, abort the agent action and return to safe state
|
|
97
|
+
- the HITL gate must be rendered as a visible, keyboard-accessible modal — not a background confirmation; screen readers must announce the approval request
|
|
98
|
+
|
|
99
|
+
**Calling AI APIs — always via backend proxy:**
|
|
100
|
+
- never call AI provider APIs (OpenAI, Anthropic, Gemini) directly from frontend code; API keys must never be in browser-accessible code
|
|
101
|
+
- all LLM calls must route through a backend proxy layer that owns: API key management, rate limiting, cost attribution, token logging, and response caching
|
|
102
|
+
- the frontend consumes the proxy API via SSE or standard REST — it has no knowledge of which AI provider is used or what system prompt is sent
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
### WCAG 2.2 AA Legal Compliance (2026)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
WCAG 2.2 AA is the mandatory legal baseline under EU EN 301 549, the UK Equality Act 2010, and ADA/Section 508. Frontend developers must implement all 9 new success criteria introduced in WCAG 2.2:
|
|
112
|
+
|
|
113
|
+
**WCAG 2.2 AA — new criteria (legally required):**
|
|
114
|
+
| Criterion | Level | Frontend Implementation |
|
|
115
|
+
|-----------|-------|------------------------|
|
|
116
|
+
| **2.4.11 Focus Not Obscured (Minimum)** | AA | Sticky headers, footers, overlays, and chat widgets must not fully cover a focused element; use scroll-margin-top / scroll-padding CSS properties on focusable elements beneath fixed bars |
|
|
117
|
+
| **2.5.7 Dragging Movements** | AA | All drag-and-drop interactions must have a single-pointer (click/tap) alternative — buttons to move, reorder, or resize items |
|
|
118
|
+
| **2.5.8 Target Size (Minimum)** | AA | Interactive targets must be ≥ 24×24 CSS pixels, or have sufficient spacing; critical for AI chat input areas, send buttons, and action chips |
|
|
119
|
+
| **3.2.6 Consistent Help** | A | Help mechanisms (support chat, FAQ links, contact) must appear in the same relative location across all pages in the site |
|
|
120
|
+
| **3.3.7 Redundant Entry** | A | Auto-populate previously entered data in multi-step flows; do not force users to re-enter information already provided in the same session |
|
|
121
|
+
| **3.3.8 Accessible Authentication (Minimum)** | AA | Authentication must not rely on cognitive function tests (puzzles, memorization, image recognition); directly impacts CAPTCHA choice — Turnstile (Cloudflare) or audio CAPTCHA is compliant; standard image CAPTCHAs are not |
|
|
122
|
+
|
|
123
|
+
**WCAG 2.2 for AI-powered UIs specifically:**
|
|
124
|
+
- **`aria-live="polite"` on streaming containers** is mandatory: screen readers cannot announce streaming AI tokens without an aria-live region; add `role="log"` + `aria-live="polite"` to all AI response containers
|
|
125
|
+
- **focus management after agent actions**: when an agent modifies the DOM, move focus to a meaningful element (e.g., the newly rendered result or a status notification); do not leave focus on a trigger element that no longer reflects current state
|
|
126
|
+
- **AI-generated content must be accessible**: validate any AI-generated HTML markup with axe-core before DOM insertion; AI tools frequently generate inaccessible markup (missing alt attributes, missing labels, incorrect ARIA roles)
|
|
127
|
+
- **WCAG 3.0** is in working draft — not yet required, but monitor for the new scoring model; design system tokens and component patterns adopted now will ease the transition
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
### Performance-as-a-Product (2025-2026)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
Performance is a direct revenue driver. A 100ms improvement in response time can increase conversion by 1%; a poor INP score degrades perceived quality for all users. Enforce this at the engineering level:
|
|
137
|
+
|
|
138
|
+
**Core Web Vitals (CWV) — the 2026 standards:**
|
|
139
|
+
| Metric | What it measures | Target |
|
|
140
|
+
| ------ | ---------------- | ------ |
|
|
141
|
+
| **INP** (Interaction to Next Paint) | Overall session responsiveness (replaced FID in 2024) | <200ms |
|
|
142
|
+
| **LCP** (Largest Contentful Paint) | Perceived load speed | <2.5s |
|
|
143
|
+
| **CLS** (Cumulative Layout Shift) | Visual stability | <0.1 |
|
|
144
|
+
|
|
145
|
+
- **INP is the definitive responsiveness metric** in 2026: it measures every interaction throughout the session, not just the first (FID). A page that loads fast but stutters on interactions will still fail CWV.
|
|
146
|
+
- prioritize **field data (CrUX)** over lab data (Lighthouse scores): a 100/100 Lighthouse score on a fast dev machine does not represent real users on slow devices or mobile networks
|
|
147
|
+
|
|
148
|
+
**Performance budgets in CI/CD:**
|
|
149
|
+
- define and enforce JS bundle size budgets per route; fail CI if a change causes a bundle to exceed the budget
|
|
150
|
+
- define CWV budgets per page type and integrate CWV regression detection in CI (Lighthouse CI or equivalent)
|
|
151
|
+
- treat a CWV budget breach as a blocking defect, not a polish item
|
|
152
|
+
|
|
153
|
+
**Rendering strategy decision framework** — choose intentionally for each route:
|
|
154
|
+
| Strategy | Use when | Performance profile |
|
|
155
|
+
| -------- | -------- | ------------------- |
|
|
156
|
+
| **SSG** (Static Site Generation) | Content rarely changes, no user personalization | Fastest: CDN-cached HTML |
|
|
157
|
+
| **SSR** (Server-Side Rendering) | Personalized or frequently updated content | Fast TTFB, full HTML for SEO |
|
|
158
|
+
| **ISR** (Incremental Static Regeneration) | Content changes on a schedule | CDN cache + background revalidation |
|
|
159
|
+
| **CSR** (Client-Side Rendering) | Highly interactive, auth-gated dashboards | Worst for initial load; acceptable for app-shell after hydration |
|
|
160
|
+
| **Partial hydration / Islands** | Content-heavy pages with isolated interactive islands | Minimal JS: only interactive components hydrate |
|
|
161
|
+
|
|
162
|
+
**Optimization tactics for INP:**
|
|
163
|
+
- **break up long tasks**: any JS task >50ms on the main thread delays interaction response; use `scheduler.yield()` or task chunking
|
|
164
|
+
- **defer non-essential third-party scripts**: analytics, chat widgets, and ad scripts must not block interaction readiness
|
|
165
|
+
- **prioritize LCP elements**: use `fetchpriority="high"` on above-the-fold images and critical resources
|
|
166
|
+
- **adaptive hydration**: prioritize hydrating components based on user viewport position and device capability, not page order
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
### Accessibility-as-CI-Gate (2025-2026)
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
Accessibility review as a manual, pre-merge concern is insufficient at 2026 delivery pace. The production standard is **automated a11y enforcement baked into CI as a hard quality gate**, blocking merge on regression rather than relying on manual checklists:
|
|
176
|
+
|
|
177
|
+
**axe-core CI enforcement (hard gate):**
|
|
178
|
+
- integrate `@axe-core/playwright` into the CI test suite; run a11y scans on every PR against all affected routes and component states
|
|
179
|
+
- configure CI to **fail the build** on any new axe-core violation (do not allow existing violations to suppress new ones via a blanket ignore list; use targeted `rules: { 'rule-id': { enabled: false } }` for known exceptions with documented rationale)
|
|
180
|
+
- scan all user-facing states: not only the happy path render; include empty states, error states, and permission-limited states in the scan scope
|
|
181
|
+
- treat axe-core scan failures as P1 blocking defects, not style preferences; inaccessible controls are a legal liability under WCAG 2.2 AA (required by EU EN 301 549, ADA, and Section 508)
|
|
182
|
+
|
|
183
|
+
**Lighthouse CI continuous a11y tracking:**
|
|
184
|
+
- configure Lighthouse CI to track the Accessibility score alongside CWV metrics on every PR; publish score trends in the CI report
|
|
185
|
+
- set a minimum Lighthouse Accessibility score budget (e.g., 95+); score drops below budget trigger the same review process as CWV budget breaches
|
|
186
|
+
- use Lighthouse CI historical comparison to catch gradual score erosion across many small PRs that individually pass the axe-core hard gate
|
|
187
|
+
|
|
188
|
+
**A11Y enforcement in AI-generated UI:**
|
|
189
|
+
- AI tools (Cursor, Copilot, v0) frequently omit ARIA roles, focus management, and keyboard navigation; the axe-core CI gate catches these automatically
|
|
190
|
+
- for High-tier AI-generated UI (auth, payment, permission-conditional rendering): manual a11y review remains mandatory in addition to the automated gate
|
|
191
|
+
- the axe-core CI gate does not replace manual testing with VoiceOver/NVDA/JAWS for complex interactive components; it catches the systematic, automatable failures
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
### Edge-Side Rendering — React Server Components at CDN Edge (2025-2026)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
The rendering strategy table covers SSR/CSR/SSG/ISR/Islands. A new architectural option in 2026 is **React Server Components (RSC) executing directly on the CDN edge** (Cloudflare Workers + Vite Cloudflare plugin), which is architecturally distinct from origin-server SSR and changes the performance profile and constraint set:
|
|
201
|
+
|
|
202
|
+
**Edge RSC vs. origin SSR — key distinctions:**
|
|
203
|
+
| Dimension | Origin SSR | Edge RSC (Cloudflare Workers) |
|
|
204
|
+
|-----------|-----------|-------------------------------|
|
|
205
|
+
| **TTFB** | 50–200ms typical (origin round-trip) | Near-zero (executed at nearest PoP) |
|
|
206
|
+
| **Runtime** | Node.js (full API) | V8 isolate (no Node.js APIs, no filesystem, no native modules) |
|
|
207
|
+
| **Streaming** | Node.js `ReadableStream` | `TransformStream` (Web Streams API only) |
|
|
208
|
+
| **State** | In-memory / Redis | Durable Objects (stateful coordination at edge) |
|
|
209
|
+
| **Cold starts** | Container warm-up (100ms–1s) | Isolate cold start (<5ms) |
|
|
210
|
+
| **Cost** | Per-second compute | Per-request microsecond billing |
|
|
211
|
+
|
|
212
|
+
**Edge-compatibility constraints — must validate before deploying RSC to edge:**
|
|
213
|
+
- **No Node.js APIs**: "fs", "path", "crypto" (Node version), "child_process", "Buffer" (non-Web), and any npm package that wraps them will fail at the edge; use Web APIs equivalents (`crypto.subtle`, `TextEncoder`, `URL`)
|
|
214
|
+
- **No native Node modules** (`.node` binaries): any npm package with native bindings cannot run in a V8 isolate; audit all RSC dependencies with `wrangler types` or the CF compatibility checker
|
|
215
|
+
- **Streaming is TransformStream-based**: RSC streaming uses Web Streams; libraries that pipe via Node.js "stream" require adaptation
|
|
216
|
+
- **Durable Objects for stateful edge**: if RSC needs per-user session state at the edge, use Durable Objects (WebSocket hibernation for long-lived connections); do not attempt to hold state in V8 isolate memory across requests
|
|
217
|
+
- **Bundle size limit**: Cloudflare Workers have a 10MB (compressed) script limit; monitor RSC bundle size; code splitting is required for large component trees
|
|
218
|
+
|
|
219
|
+
**When to choose Edge RSC over origin SSR:**
|
|
220
|
+
- choose Edge RSC when: TTFB is the primary bottleneck, the route has no Node.js-specific dependencies, personalization data is available at the edge (via KV, D1, or Durable Objects), and the component tree is within bundle limits
|
|
221
|
+
- choose origin SSR when: the route requires Node.js APIs, uses native npm modules, or needs large database queries that benefit from origin proximity
|
|
222
|
+
- **EDGE-RENDERING-COMPAT LOCK** applies: the decision to deploy RSC to the edge is an architectural choice that must be validated, not an automatic optimization
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
### PWA-Agent Bridge — Service Workers as Agentic Control-Plane (2025-2026)
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
In 2026, Service Workers are evolving beyond caching and offline support into **agentic orchestration infrastructure**: managing background AI task delegation, polling agent status, and bridging AI task completion back to the user interface:
|
|
232
|
+
|
|
233
|
+
**Service Worker as agentic control-plane:**
|
|
234
|
+
- use Service Workers to orchestrate background AI task delegation: the SW intercepts fetch requests to AI endpoints, queues tasks when offline, and retries with exponential backoff using `Periodic Background Sync`
|
|
235
|
+
- `Background Sync API`: when the device regains connectivity, the SW automatically retries queued AI tasks without requiring the user to re-submit; critical for mobile users on unreliable connections
|
|
236
|
+
- `Periodic Background Sync API`: for agent check-in patterns where the app periodically polls for completed agent tasks, updates, or model refreshes without requiring the user to open the app
|
|
237
|
+
|
|
238
|
+
**Web Push API as HITL callback bridge:**
|
|
239
|
+
- for Human-in-the-Loop AI workflows (agent tasks that require user approval or input), use the `Push API` to deliver HITL notifications: the backend sends a push event when the agent reaches a decision point requiring user input
|
|
240
|
+
- the Service Worker receives the push event and shows a notification (even when the app is closed); the user taps to open the app and complete the HITL step
|
|
241
|
+
- this enables truly async agentic workflows: the user initiates a task, the agent works in the background, and the push notification bridges the HITL callback
|
|
242
|
+
|
|
243
|
+
**Service Worker scope and security constraints:**
|
|
244
|
+
- Service Workers must not execute LLM inference directly; inference must be delegated to cloud AI agents or native app layers; the SW is a control-plane, not a compute engine
|
|
245
|
+
- validate message origin for all `postMessage` communication between SW and the app; do not process messages from untrusted origins
|
|
246
|
+
- Service Worker registration scope limits which routes the SW controls; scope must be declared explicitly and reviewed for overly broad coverage
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
### Browser-Native Module Federation (2025-2026)
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
For micro-frontend architectures or large frontend applications with independent team delivery, 2026 introduces a production-viable alternative to Webpack Module Federation: **Import Maps + ESM (Browser-Native Federation)**:
|
|
256
|
+
|
|
257
|
+
**Import Maps (<script type="importmap">):**
|
|
258
|
+
- Import Maps are a W3C standard (~94.5% browser coverage in 2026, with es-module-shims for compatibility fallback); they allow remapping bare module specifiers to URLs at the browser level without a bundler
|
|
259
|
+
- use Import Maps to share singleton dependencies (React, a design system library) across independently deployed micro-frontends without bundler coordination; each micro-frontend declares its own modules, and the Import Map enforces shared singleton versions
|
|
260
|
+
- Import Maps are a static JSON declaration served with the HTML shell; updates to the map require an HTML shell deployment, not a library rebuild
|
|
261
|
+
|
|
262
|
+
**Native Federation decision framework — when to use which approach:**
|
|
263
|
+
| Approach | Use when |
|
|
264
|
+
|----------|----------|
|
|
265
|
+
| **Import Maps + ESM** | Small to medium micro-frontend teams; bundler-agnostic requirement; singleton enforcement is the primary concern; no complex shared state across micro-frontends |
|
|
266
|
+
| **Module Federation 2.0** (Webpack/Rspack) | Large teams with complex dynamic loading requirements; runtime feature flags for shared modules; need for runtime version negotiation between independently deployed apps |
|
|
267
|
+
| **Single bundled app** | Team size <5 FE engineers; feature velocity over deployment independence; complexity cost of federation exceeds the benefit |
|
|
268
|
+
|
|
269
|
+
**Singleton management with Import Maps:**
|
|
270
|
+
- the primary risk of module federation (any approach) is **duplicate framework instances** (two React copies in the same page); this causes silent failures (hooks state isolation, context disappearing, event system splits)
|
|
271
|
+
- in Import Maps: pin React, ReactDOM, and all shared singletons in the Import Map with exact version URLs; micro-frontends must not bundle their own copy of pinned singletons
|
|
272
|
+
- verify singleton enforcement at runtime with `window.__REACT_DEVTOOLS_GLOBAL_HOOK__` or equivalent; if two React instances are present, the Import Map has a gap
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
---
|
|
@@ -100,8 +100,8 @@ This reference checklist provides detailed test engineering, quality gates, and
|
|
|
100
100
|
- Cilium Tetragon and Beyla sensors integrated in test environments to monitor system calls (`sys_enter_connect`, `sys_enter_execve`)
|
|
101
101
|
- execution sandboxes verified to make zero unauthorized network egress connections or unexpected subprocess spawns
|
|
102
102
|
|
|
103
|
-
### 7. Modern Web, Browser Automation & Accessibility (Playwright v1.
|
|
104
|
-
- **Playwright v1.
|
|
103
|
+
### 7. Modern Web, Browser Automation & Accessibility (Playwright v1.64+)
|
|
104
|
+
- **Playwright v1.64+ Automation Standards**:
|
|
105
105
|
- browser tests executed in isolated browser contexts with automated Trace Viewer capture on test failure
|
|
106
106
|
- transport-level network interception enforced via Mock Service Worker (MSW v2) or HAR network replay; application-level monkey-patching of `window.fetch` strictly prohibited
|
|
107
107
|
- arbitrary sleep calls (`page.waitForTimeout`) eliminated; Playwright web-first assertions with locator auto-waiting (`await expect(locator).toBeVisible()`) enforced
|
|
@@ -131,12 +131,12 @@ This reference checklist provides detailed test engineering, quality gates, and
|
|
|
131
131
|
- HTTP error rate $< 0.1\%$
|
|
132
132
|
- k6 threshold rules configured to exit with non-zero exit code (exit code 99) upon SLO breach, blocking deployment
|
|
133
133
|
|
|
134
|
-
### 9. Clean Architecture Multi-Language QA (Go 1.
|
|
135
|
-
- **Go 1.
|
|
134
|
+
### 9. Clean Architecture Multi-Language QA (Go 1.27+, Python, TypeScript)
|
|
135
|
+
- **Go 1.27+ Kratos Clean Architecture Test Isolation**:
|
|
136
136
|
- Kratos 4-layer separation strictly enforced: `api/` (contracts) $\rightarrow$ `internal/service` (adapters) $\rightarrow$ `internal/biz` (business invariants) $\rightarrow$ `internal/data` (GORM persistence)
|
|
137
137
|
- zero database ORM (`gorm.DB`) leakage into `internal/biz`; domain invariants testable via pure unit tests with zero I/O
|
|
138
138
|
- **Ephemeral Database Parity via Testcontainers-Go**:
|
|
139
|
-
- in-memory SQLite mocks replaced with real PostgreSQL
|
|
139
|
+
- in-memory SQLite mocks replaced with real PostgreSQL 18 Alpine containers spun up programmatically via `testcontainers/testcontainers-go` managed by Ryuk reaper
|
|
140
140
|
- complete engine feature parity ensured (JSONB operations, window functions, concurrency locks, indexing)
|
|
141
141
|
- **Zero-Dirty State with GORM `InTx` Rollbacks**:
|
|
142
142
|
- each database integration test wrapped in an explicit transaction (`tx := db.Begin()`), repository operations executed within the transaction, and deferred `tx.Rollback()` invoked on teardown
|
|
@@ -188,3 +188,8 @@ This reference checklist provides detailed test engineering, quality gates, and
|
|
|
188
188
|
- blast radius assessment verifies failure domain containment; zero cross-boundary impact detected
|
|
189
189
|
- skipped checks and residual risk are explicit, justified, and documented in `contracts/schemas/test-report.json`
|
|
190
190
|
- release confidence is supported by empirical evidence, not confidence language
|
|
191
|
+
|
|
192
|
+
### 14. 2026-10 Modernization Gates
|
|
193
|
+
- **Stack-Currency Gate**: ephemeral test parity runs on the 2026-10 baseline — Go 1.27+ (1.27 released 2026-08) and PostgreSQL 18 Testcontainers (PG 19 GA planned 2026-11-19); previous-generation Go or PostgreSQL pins fail currency review.
|
|
194
|
+
- **Playwright-Currency Gate**: browser automation targets Playwright v1.64+ (1.64.1 released 2026-10-13; v1.62+ required for MCP-era features); v1.48-era pins fail currency review.
|
|
195
|
+
- **Toolchain-Alignment Gate**: QA stack pins match the Backend Developer Stack Currency baseline (Go 1.27+, Python 3.14+, Node 26 LTS line, PostgreSQL 18) so test environments never drift from production runtimes; re-validate quarterly.
|