使Claude在网页开发中更具自主性的提示

3作者: louison1125 天前原帖
告诉你的Claude将这些内容放入MEMORY.md文件中,以便进行更自主的开发会话。<p>在过去的一周里,这让我Claude的工作变得轻松了两倍。很多时候,它会构建某个功能,然后我会发现一个bug。现在它能自己找到bug,并不断迭代,直到确认一切都完美运行。这很简单,但在自主性方面提升了一个档次。<p>提示:<p>“将此添加到你的MEMORY.md文件中(或根据我们的项目进行调整):<p>## 关键规则<p>### 始终在交付前进行测试<p>- 永远不要在未先验证的情况下告诉用户某个功能可用<p>- 每次代码更改后:重建、重启服务器,然后测试实际页面/API响应<p>- 重建Next.js后:始终重启服务器——旧构建中的过时JS块会导致客户端错误<p>- 通过公共URL进行测试,而不仅仅是localhost<p>- 检查服务器端渲染(使用curl获取HTML)和客户端(验证JS块是否加载)<p>- *使用PLAYWRIGHT进行UI测试*——不要仅仅使用curl获取页面。使用Playwright与无头Chrome实际渲染页面、点击按钮、填写表单并截图。这是捕捉客户端JS错误、布局破损和用户体验问题的唯一方法。<p>- 截图保存到`/tmp/playwright-screenshots/`——查看它们以视觉验证UI<p>- 不要要求用户进行测试。在交付之前自己找到bug。”
查看原文
Tell your Claude to put this in MEMORY.md file for much more autonomous development sessions.<p>It&#x27;s made my Claude work 2x easier in the last week. So many times it&#x27;d build something then I&#x27;d find a bug. Now it finds the bugs on its own and reiterates until it&#x27;s sure everything works perfectly. It&#x27;s so simple but it brings it to the next level in terms of autonomy.<p>Prompt:<p>&quot;Add this to your MEMORY.md file (or adapt the following to match our project best):<p>## Critical Rules<p>### Always test before delivering<p>- NEVER tell the user something works without verifying it yourself first<p>- After every code change: rebuild, restart server, then test the actual page&#x2F;API response<p>- After rebuilding Next.js: ALWAYS restart the server — stale JS chunks from old builds cause client-side errors<p>- Test through the public URL, not just localhost<p>- Check both server-side rendering (curl the HTML) AND client-side (verify JS chunks load)<p>- *USE PLAYWRIGHT FOR UI TESTING* — don&#x27;t just curl pages. Use Playwright with headless Chrome to actually render pages, click buttons, fill forms, and take screenshots. This is the ONLY way to catch client-side JS errors, broken layouts, and UX issues.<p>- Screenshots go to `&#x2F;tmp&#x2F;playwright-screenshots&#x2F;` — read them to visually verify the UI<p>- Do NOT ask the user to test. Find the bugs yourself before delivering.&quot;