Ai-agent-instructions eapp-webview
Develops React-based tablet WebView applications with touch-optimized UI, native bridge communication, workflow routing systems, and responsive tablet layouts. Enforces reuse of existing components/utils/hooks before creating new ones. Use this skill whenever the user works on tablet webview features, e-app tablet UI, webview bridge communication, workflow routing, or any tablet-specific React development with native integration.
git clone https://github.com/khumbal/ai-agent-instructions
T=$(mktemp -d) && git clone --depth=1 https://github.com/khumbal/ai-agent-instructions "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.copilot/skills/eapp-webview" ~/.claude/skills/khumbal-ai-agent-instructions-eapp-webview && rm -rf "$T"
.copilot/skills/eapp-webview/SKILL.mdE-App Tablet WebView Development
When to use this skill
Use when building tablet webview features, e-app UI components, native bridge communication, or workflow routing in the React-based tablet application.
Conditional workflow
-
Determine what you're building:
New UI component? → Search
first → Extend or adapt existing → Create new only if nothing similar exists Business logic? → Checksrc/components/
andsrc/functions/
first Navigation/routing? → Use workflow routing system (config-driven, see below) Native bridge call? → Followsrc/services/
patterns Performance fix? → Profile first → optimize renders/bridge callssrc/communication.ts
Pre-analysis (mandatory)
Before writing any code:
- Read README.md and package.json
- Search existing code — never create new when reusable components exist:
— Button, Modal, Forms, Table, DatePicker, Icons, Textsrc/components/
— helpers, logger, environment, validationsrc/utils/
— custom hooks and workflow routing hookssrc/hooks/
— API services and data layerssrc/services/
— business logicsrc/functions/
— context providers and state managementsrc/providers/
— workflow routing and navigationsrc/workflow/
Use
semantic_search, file_search, or grep_search to verify before creating anything.
Tablet-specific constraints
These are non-negotiable rules specific to this project:
- Touch targets: Minimum 44px for ALL interactive elements
- No CSS transforms on interactive elements — causes visual glitches on tablet WebView. Use transitions on color, opacity, box-shadow instead
- Layout: CSS Grid/Flexbox, tablet-first design, handle orientation changes (landscape + portrait)
- Performance: Minimize bridge call frequency and payload size, batch UI updates
- Security: HTTPS in webview, input sanitization, XSS prevention
WebView bridge communication
Follow existing
src/communication.ts patterns strictly (low freedom — fragile API):
// Type-safe native bridge interface interface NativeBridge { sendMessage(type: string, payload: Record<string, unknown>): void; onMessage(handler: (message: BridgeMessage) => void): void; }
Rules:
- Use existing message types and interfaces — do not create new ones without reviewing existing
- Handle bridge failures with error boundaries
- Validate all data crossing the bridge boundary
Workflow routing system
- Configuration-driven approach (not hard-coded routes)
- Integrate with
and dynamic component loadingWorkflowProvider - Use existing handlers and middleware patterns
- Implement error boundaries with fallback strategies
Code standards
- Logging: Use
function (notlogger
). Checkconsole.log
for debug.shouldEnableConsoleLog() - Types: Proper TypeScript interfaces, no
(especially in bridge messages)any - Error handling: Error boundaries for webview crash handling, graceful connectivity changes
Feedback loop
After implementing changes:
- Verify touch interactions work on tablet (44px targets, no transform glitches)
- Test bridge communication end-to-end
- Test orientation changes
- If any fails → fix → retest (loop until all pass)