Agent skill
stagehand-expert
Master Architect in Stagehand V3. Expert in Direct CDP Automation, Decision Caching, and Agentic Web Orchestration for 2026.
Install this agent skill to your Project
npx add-skill https://github.com/YuniorGlez/gemini-elite-core/tree/main/skills/stagehand-expert
SKILL.md
🎭 Skill: Stagehand Expert (v4.1.0)
Executive Summary
The stagehand-expert is the elite specialist in browser automation and high-precision agent orchestration. In 2026, web automation has shifted from brittle selectors to Natural Language Primitives and Direct CDP Communication. This skill focuses on mastering Stagehand V3, leveraging Decision Caching for zero-cost CI/CD, and navigating complex Shadow DOM/iframe structures with 44% more velocity.
📋 Table of Contents
- Proactive Investigation Protocol
- The "Do Not" List (Anti-Patterns)
- Core Primitives (Act, Extract, Observe)
- Direct CDP & Performance
- Advanced Agent Caching
- Autonomous Agents (CUA)
- Reference Library
🔍 Proactive Investigation Protocol
Before writing a single test, the expert MUST perform a Deep Discovery:
- Route Mapping: identify the user flow from
page.tsxor router configs. - UI Component Audit: Read source code to find IDs, labels, and loading states.
- Vibe Check: Measure layout stability using the CDP "Vibe Score."
- Schema Inference: Analyze existing backend/DB types to create 100% compatible
extract()Zod schemas.
🚫 The "Do Not" List (Anti-Patterns)
| Anti-Pattern | Why it fails in 2026 | Modern Alternative |
|---|---|---|
| Manual Frame Switching | Fragile and slow. | Use DeepLocator (>>) & CDP. |
| Hardcoded Wait(2000) | Unreliable and causes jank. | Use domSettleTimeout. |
| Missing finally { close() } | Leaves zombie processes. | Mandatory try...finally. |
| LLM Calls in CI | Slow and expensive. | Use Persistent Decision Caches. |
| Ignoring CSS Animations | Interactions fail during transitions. | Use Reanimated-aware Waiters. |
⚡ Core Primitives Mastery
- Act: Precise natural language instructions with mapped variables.
- Observe: Single-turn identification of all page elements for 70% cost reduction.
- Extract: Structured, Zod-validated data pulling with semantic flattening.
💾 Advanced Decision Caching
Transform E2E tests into a deterministic asset:
- Develop Locally: Live LLM generates the cache.
- Commit Cache: Store DOM snapshots and results in Git.
- Zero-Cost CI: Run tests in "Cached-Only" mode.
See References: Agent Caching for details.
🤖 Autonomous Agents & CUA
For the most complex UIs (Cross-origin iframes, dynamic canvas):
- Computer Use Agent (CUA): Pure visual reasoning for impossible-to-parse elements.
- Safety Callbacks: Mandatory human-in-the-loop for financial or destructive actions.
📖 Reference Library
Detailed deep-dives into Stagehand Excellence:
- Direct CDP Communication: Velocity and deep access.
- Agent Caching: Determinism and cost savings.
- Shadow DOM Mastery: Jumping документ boundaries.
- Installation & Setup: The Bun/Playwright stack.
Updated: January 22, 2026 - 21:20
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
filesystem-context
Uso del sistema de archivos como extensión de la ventana de contexto, persistencia de planes, comunicación entre sub-agentes y carga dinámica de habilidades.
git-flow
Senior Workflow Architect. Master of Trunk-Based Development, Stacked Changes, and 2026 Branching Strategies.
track-master
Senior Progress Analyst & Conductor Strategist. Expert in Predictive Project Tracking and Agentic Milestone Management for 2026.
artifact-janitor
Senior Build Cleanup & System Optimization Specialist. Expert in reclaiming disk space and resolving build corruption in 2026 ecosystems.
openapi-pro
Senior API Architect & Integration Engineer for 2026. Specialized in Type-Safe API contracts using OpenAPI 3.1, Zod-First schema derivation, and automated TypeScript client generation. Expert in bridging the gap between Hono backends and Next.js 16 frontends using `openapi-fetch`, `orval`, and unified monorepo type-sharing.
seo-pro
Senior SEO Architect & Content Strategist. Expert in SGE Optimization, E-E-A-T Standards, and Semantic Entity SEO for 2026.
Didn't find tool you were looking for?