🤖 Sponsored by Browserbase: Sign up today ► https://browserbase.plug.dev/ekNRhob
🎥 Watch the Episode ► How to Reduce 90% of Errors with Claude Code
Get Builder Pack ► Click Here
Welcome Insiders! This enhanced repository contains exclusive learning materials and the complete test suite from Episode 9. Learn how to reduce 90% of errors using Test-Driven Development with AI-powered testing and Stagehand's natural language testing framework.
browserbase-claude-code-stagehand/
├── README.md # This file
├── CLAUDE.md # Claude Code guidance file
├── LESSON.md # 🎓 INSIDERS EXCLUSIVE: Complete learning guide
├── PRD.md # 🎓 INSIDERS EXCLUSIVE: Product requirements document
├── .claude/ # Claude Code configuration
│ ├── agents/ # AI agent definitions
│ │ └── stagehand-expert.md # Stagehand testing specialist agent
│ ├── commands/ # Custom commands
│ │ └── agent_prompts/ # Agent prompt templates
│ │ └── stagehand_expert_prompt.md
│ └── output-styles/ # Output formatting rules
│ └── pragmatic-test-driven-developer.md # TDD enforcement style
└── my-app/
└── tests/ # Complete test suite implementations
├── README.md # Comprehensive test documentation
├── playwright/ # Traditional selector-based tests
│ ├── baseline.spec.ts # Basic structure & element presence
│ ├── interactions.spec.ts # User interactions & validations
│ └── color-mixer.spec.ts # Full workflow tests
└── stagehand/ # AI-powered natural language tests
├── baseline-stagehand.spec.ts # AI element discovery
├── interactions-stagehand.spec.ts # Natural language interactions
└── color-workflows.spec.ts # Complex AI workflows
Copy everything from .claude into the root of your Claude Code project:
cp -r .claude/* /path/to/your/project/.claude/
Tag @agent-stagehand-expert in any task related to writing or running tests. This agent specializes in:
Run /output-style and select "Pragmatic Test Driven Developer" to enforce the Red → Green → Verify cycle automatically in your development workflow.
# Run Playwright tests
npx playwright test tests/playwright/
# Run Stagehand tests
npx playwright test tests/stagehand/
LESSON.md)PRD.md)my-app/tests/).claude/agents/stagehand-expert.md).claude/output-styles/pragmatic-tdd-developer.md)As an AI Insiders Club member, you have access to:
/dev:design-app, /dev:implement-mvp)Take your skills further with the complete implementation:
Get Builder Pack ► Click Here
The Test-Driven Development cycle demonstrated in this episode:
1. RED PHASE (Write Test)
└── Write test for desired functionality
└── Run test to confirm it fails
└── State: "❌ Test written and failing"
2. GREEN PHASE (Implement Code)
└── Write minimal code to pass test
└── No extra features or additions
└── State: "✅ Test passing"
3. VERIFY PHASE (Check Results)
└── Run all tests to ensure nothing broke
└── Manual verification if needed
└── State: "✅ Ready for next feature"
This repository contains the free resources from Episode 9. Contributions welcome:
Please open an issue first to discuss major changes.
MIT License - See LICENSE file for details
Remember: The best way to reduce errors isn't to write more code - it's to write tests first! 🧪
Start with Stagehand today ► https://browserbase.plug.dev/ekNRhob
—
$ claude mcp add browserbase-claude-code-stagehand \
-- python -m otcore.mcp_server <graph>