Elevating AI frontend quality and avoiding chaos
Effectively reduce the problem of AI generating ugly or buggy frontend code by choosing the right AI tools, configuring MCP services (such as Playwright, Figma Dev Mode, and Chrome DevTools) to get real context and browser validation, and writing project rule files (such as AGENTS.md or .cursor/rules).
DEV.to #vibecoding
CursorClaude Codev0BoltWindsurfPlaywright MCPChrome DevTools MCPFigma Dev Mode MCP+3
Added 2026-11-11 · originally published Tue, 10 Nov 2026 09:21:35 +0000
Key points
- Configure real tools and external context for the AI (such as Playwright MCP allowing the AI to check work in a real browser, and Figma Dev Mode MCP converting design data into matching code).
- Use rule files (such as AGENTS.md, .cursor/rules, CLAUDE.md, .clinerules, .github/copilot-instructions.md) to set project boundaries for the AI (e.g., tech stack, running tests, prohibiting modification of specific directories, prohibiting unauthorized addition of dependencies).
- Save operations that are repeatedly explained multiple times (such as "add a new API route" or "write Playwright tests") as skills or commands.
- Use guardrail plugins (such as ESLint / Prettier / Biome, Error Lens, Playwright Test for VS Code) to let the AI fix warnings itself or quickly locate errors.
Pitfalls
- The AI tends to guess APIs out of thin air or produce ugly/buggy code when lacking real context and tool support.
- The AI forgets previous conventions or context between different conversations.
- Letting the AI blindly modify code may break the production environment or introduce unauthorized dependencies.
.cursorrules
# Project rules - Stack: Next.js, TypeScript strict, Tailwind - Run `npm test` before saying a task is done - Never edit files in /generated - No new dependencies without asking
Copy-ready prompt
Please write the code according to the following rules and project context: - Stack: [fill in your tech stack, e.g., Next.js, TypeScript strict, Tailwind] - You must run tests and ensure they pass after completing the task. - Strictly prohibit modifying files in specific directories [e.g., /generated]. - If you need to introduce any new dependencies, you must ask the user first. - Please use associated tools (such as Playwright or Chrome DevTools) to verify the UI and console errors.
#AI Frontend Development#Vibe Coding#Cursor#MCP
Related techniques
Summarized by AI from the original source - refer to the original post for details. Copyright belongs to the original author.