Fullstack Dev、iOS Reverse Engineering、小红书逆向培训
"如果你也想了解AI真正如何参与软件开发,这个网站或许能给你一些启发。"
最近,我完成了一个叫 AutoQA-Agent 的项目开发。和以往不同的是,这次我全程使用 BMad v6 这套 AI 驱动开发方法,让 AI Agent 像真正的团队成员一样参与协作——从架构设计到功能实现,从代码重构到问题排查,每一个关键环节都留下了对话记录。
整理下来,一共有 32 个完整的对话。
我觉得这些对话太有价值了,它们真实记录了 AI 如何像一个"技术合伙人"一样参与开发。于是,我用 Lovable 把它们做成了一个网站:
网站里有什么?
这 32 个对话记录覆盖了软件开发的方方面面:
架构设计
- 如何与 AI 架构师 Winston 协作创建架构文档
- 动态 Base URL 支持的方案讨论
- Epic 7 的重新设计
功能开发
- 敏感测试数据注入
- Markdown Include 功能实现
- 应用探索引擎开发
- 智能测试用例生成器
代码重构
- 测试生成环境变量重构
- Story 7.1 的实现重构
问题排查
- 浏览器闪烁问题
- 探索记录修复
- 定位器导出失败调试
需求管理
- Story 2.10、7.1、8.1、8.2、8.3 的创建
为什么要分享?
随着 AI coding tools 越来越火,很多人问我:"AI 真的能写代码吗?"
但我发现,更值得关注的问题是:"人和 AI 应该如何协作开发?"
这个网站就是我的实践答案。它不是"AI 帮我写完了代码"的炫耀,而是真实展示了:
- AI 如何帮我梳理技术选型
- 当遇到问题时,我们如何共同排查
- 代码重构时,AI 提供了哪些视角
- 哪些地方 AI 表现出色,哪些地方仍需人工把关
BMad v6 是什么?
BMad v6 是一套 AI 驱动的开发方法论(Business Model AI Development)。它的核心思想是:
把开发过程拆解成不同的"专家角色",每个角色各司其职,你就像项目负责人一样协调这些 AI 专家协作。
比如这次 AutoQA-Agent 项目中,我就和这些 AI 角色协作过:
- Winston(架构师):负责架构设计和技术决策
- Dev(开发者):负责功能实现和代码编写
- PM(产品经理):负责需求分析和 Story 拆解
- QA(测试工程师):负责测试用例设计
就像组了一支 AI 团队,你带着他们一起把项目做出来。
谁会从中受益?
如果你是:
- 开发者:看看 AI 实际如何参与项目开发
- 产品经理:了解 AI 辅助需求管理的可能性
- 技术管理者:思考团队如何引入 AI 协作流程
- AI 爱好者:真实案例总是比抽象讨论更有启发性
希望这个网站能给你一些参考。
最后的话
这 32 个对话,是我探索"人机协作开发"的第一步,也是 BMad v6 方法论的一次完整实践。如果你也在路上,欢迎交流。
项目地址: github.com/terryso/AutoQA-Agent
对话网站: autoqa-chats.lovable.app
你在开发中有和 AI 协作的经验吗?欢迎在评论区分享你的故事。
How a simple YAML configuration built for Claude Code and Playwright MCP transformed our testing workflow and made automation accessible to everyone on the team
If you've ever maintained a large Playwright test suite, you know the pain. Hundreds of lines of JavaScript scattered across dozens of files. Hardcoded values that break when environments change. Test logic so complex that only the original author dares to modify it.
What if I told you there's a better way? A way to write tests that are readable by anyone, maintainable by design, and powerful enough to handle complex workflows?
Enter YAML-based Playwright testing for Claude Code — a paradigm shift that's changing how teams approach test automation by leveraging the power of Claude Code's AI capabilities and Playwright MCP's browser automation.
The Problem with Traditional Playwright Tests
Let's be honest about traditional Playwright tests:
// Traditional Playwright test - 50+ lines of code
test('complete order flow', async ({ page }) => {
await page.goto('https://example.com');
await page.fill('[data-testid="username"]', 'user123');
await page.fill('[data-testid="password"]', 'pass456');
await page.click('[data-testid="login-btn"]');
await expect(page.locator('h1')).toContainText('Dashboard');
// ... 40+ more lines of clicking, filling, asserting
// ... hardcoded values everywhere
// ... no reusability between tests
});
Problems:
- ❌ Verbose and complex — Simple actions buried in boilerplate
- ❌ Hardcoded values — Environment changes break everything
- ❌ Poor reusability — Copy-paste leads to maintenance nightmares
- ❌ Technical barrier — Only developers can write/modify tests
- ❌ Scattered logic — Related tests live in different files
The YAML Revolution: Tests That Make Sense
Now imagine the same test written in YAML:
# test-cases/order.yml
tags:
- smoke
- order
- checkout
steps:
- include: "login"
- "Click Add to Cart button for first product"
- "Click Add to Cart button for second product"
- "Click shopping cart icon in top right"
- "Enter First Name"
- "Enter Last Name"
- "Enter Postal Code"
- "Click Continue button"
- "Click Finish button"
- "Verify page displays Thank you for your order!"
- include: "cleanup"
Immediate benefits:
- ✅ Crystal clear intent — Anyone can understand what this test does
- ✅ Natural language — Steps read like user stories
- ✅ Reusable components — Login and cleanup are shared across tests
- ✅ Environment agnostic — No hardcoded values in sight
The Magic Behind the Simplicity
1. Reusable Step Libraries
Common workflows become building blocks:
# steps/login.yml
steps:
- "Open {{BASE_URL}} page"
- "Fill username field with {{TEST_USERNAME}}"
- "Fill password field with {{TEST_PASSWORD}}"
- "Click login button"
- "Verify page displays Swag Labs"
Write once, use everywhere. No more copy-paste madness.
2. Environment Variable Magic
Different environments? No problem:
# .env.dev
BASE_URL=https://dev.example.com
TEST_USERNAME=dev_user
# .env.prod
BASE_URL=https://example.com
TEST_USERNAME=prod_user
Same tests, different environments. Automatically.
3. Intelligent Tag Filtering
Run exactly what you need:
# Run only smoke tests
/run-yaml-test tags:smoke
# Run order AND checkout tests
/run-yaml-test tags:order,checkout
# Run smoke OR critical tests
/run-yaml-test tags:smoke|critical
No more running the entire suite when you only changed the login flow.
4. Smart Reporting
Automatically generated HTML reports with:
- ✅ Step-by-step execution details
- ✅ Environment configuration
- ✅ Screenshots and artifacts
- ✅ Success/failure statistics
Real-World Impact: A Case Study
Before YAML testing:
- 📊 2,000+ lines of Playwright JavaScript
- ⏱️ 3 days to onboard new QA team members
- 🐛 15+ test failures per environment change
- 👥 Only 3 developers could modify tests
After YAML testing:
- 📊 200 lines of readable YAML
- ⏱️ 30 minutes to onboard new team members
- 🐛 0 test failures during environment changes
- 👥 Entire team can write and modify tests
Why This Matters for Your Team
For Developers:
- Less time writing boilerplate, more time building features
- Tests that actually document your application's behavior
- No more "let me just quickly fix this test" rabbit holes
For QA Engineers:
- Focus on test strategy, not JavaScript syntax
- Rapid test creation and modification
- Clear visibility into test coverage
For Product Managers:
- Tests that read like acceptance criteria
- Easy to verify that tests match requirements
- Confidence that important flows are covered
For DevOps:
- Predictable test execution across environments
- Clear failure reporting and debugging
- Easy integration with CI/CD pipelines
Technical Architecture: How It Works
This YAML Playwright testing framework is specifically designed for Claude Code and Playwright MCP. The framework consists of several key components:
Claude Code Integration
- AI-Powered Execution: Claude Code's AI interprets natural language test steps and converts them to Playwright actions
- Smart Step Recognition: Advanced understanding of testing intent from plain English descriptions
- Context Awareness: Maintains context across test steps for more intelligent automation
Playwright MCP Foundation
- Browser Automation: Leverages Playwright MCP for reliable cross-browser testing
- Element Detection: Intelligent element finding and interaction
- Screenshot & Reporting: Built-in capture and documentation capabilities
Multi-Environment Configuration
├── .env.dev # Development environment
├── .env.test # Test environment
├── .env.prod # Production environment
Reusable Step Libraries
├── steps/
│ ├── login.yml # Authentication flows
│ ├── cleanup.yml # Cleanup procedures
│ └── navigation.yml # Common navigation
Test Cases with Natural Language
├── test-cases/
│ ├── order.yml # E-commerce order flow
│ ├── user.yml # User management
│ └── search.yml # Search functionality
Intelligent Execution Engine
The framework automatically:
- Loads environment-specific configuration
- Expands
includereferences from step libraries - Substitutes environment variables (
{{BASE_URL}}) - Executes tests using Playwright MCP
- Generates comprehensive reports
Getting Started: Your First YAML Test
The beauty of YAML-based testing is its simplicity. Here's how to get started:
1. Prerequisites
# Install Claude Code (if not already installed)
# Follow instructions at: https://claude.ai/code
# Install Playwright MCP for Claude Code
claude mcp add playwright -- npx -y @playwright/mcp@latest
# Clone the YAML testing framework
git clone https://github.com/terryso/claude-code-playwright-mcp-test.git
cd claude-code-playwright-mcp-test
2. Project Structure
your-project/
├── .env.dev # Environment config
├── steps/ # Reusable step libraries
├── test-cases/ # Your test cases
├── screenshots/ # Test artifacts
└── reports/ # Generated reports
3. Write Your First Test
# test-cases/login.yml
tags:
- smoke
- auth
steps:
- "Open {{BASE_URL}} page"
- "Fill username with {{TEST_USERNAME}}"
- "Fill password with {{TEST_PASSWORD}}"
- "Click login button"
- "Verify successful login"
4. Execute and Iterate
# In Claude Code, use the built-in commands
/run-yaml-test file:test-cases/login.yml env:dev
# Or run with tag filtering
/run-yaml-test tags:smoke env:dev
Within hours, you'll have tests that are more maintainable than anything you've written before. The magic happens through Claude Code's AI understanding your natural language steps and Playwright MCP executing them as browser actions.
Advanced Features
Complex Tag Filtering
# Multiple conditions
/run-yaml-test tags:smoke,login|critical
# Environment-specific execution
/run-yaml-test tags:order env:prod
Dynamic Step Parameters
steps:
- "Add product {{PRODUCT_NAME}} to cart"
- "Set quantity to {{QUANTITY}}"
- "Apply discount code {{DISCOUNT_CODE}}"
Comprehensive Reporting
- HTML Reports: Beautiful, interactive test reports
- JSON/XML Output: For CI/CD integration
- Screenshot Capture: Automatic failure documentation
- Performance Metrics: Execution timing and statistics
The Future is Readable
We're moving toward a world where:
- Tests are documentation that executes
- Anyone can contribute to test automation
- Maintenance is a joy, not a chore
- Environments are just configuration
YAML-based Playwright testing isn't just a tool — it's a philosophy. It's the belief that tests should be clear, maintainable, and accessible to everyone on the team.
Common Questions Answered
Q: How does this compare to existing solutions like Cucumber?
A: While Cucumber requires learning Gherkin syntax and step definitions, this YAML testing framework uses natural language directly with Claude Code's AI interpreting the intent. No step definition mapping needed - Claude Code understands what you want to do.
Q: What about test debugging?
A: Claude Code provides detailed execution logs, Playwright MCP captures screenshots on failure, and you get clear error messages that map back to your YAML steps. The AI context helps identify issues quickly.
Q: Can I integrate this with CI/CD?
A: Absolutely. The framework generates standard exit codes and multiple report formats (HTML, JSON, XML) for seamless CI/CD integration.
Q: How do you handle complex assertions?
A: Claude Code's AI makes natural language assertions surprisingly powerful: "Verify page contains 'Thank you'", "Verify cart total equals $43.18", "Verify 2 items in cart". The AI understands context and intent.
Take Action Today
The question isn't whether this approach is better. The question is: How much time are you willing to waste on brittle, complex tests?
Start your YAML testing journey:
- Get Claude Code: Install Claude Code and Playwright MCP
- Try the demo: Clone the project from https://github.com/terryso/claude-code-playwright-mcp-test and run your first YAML test
- Convert one test: Take your most complex Playwright test and rewrite it in YAML
- Share with your team: Show them how readable tests can be
- Scale gradually: Convert more tests as you see the benefits
Ready to transform your testing workflow with Claude Code and Playwright MCP? The future of test automation is readable, maintainable, and accessible to everyone.
🔗 Get Started: https://github.com/terryso/claude-code-playwright-mcp-test
What's your biggest pain point with current Playwright tests? How would YAML-based testing with Claude Code solve it for your team?