Claude Code 实战技巧:用 Opus 5.5
Claude Code tip, part 2: before you ship a vibe-coded site, have Opus 5.5 send o…
提供了结构清晰的多智能体协作 Prompt,将抽象的安全检查拆解为可执行的具体步骤,极具实操参考价值。
Claude Code tip, part 2: before you ship a vibe-coded site, have Opus 5.5 send out 𝟱 𝘀𝘂𝗯𝗮𝗴𝗲𝗻𝘁𝘀 to check 𝘁𝗵𝗲𝘀𝗲 𝟮𝟱 𝘁𝗵𝗶𝗻𝗴𝘀 𝗯𝗲𝗵𝗶𝗻𝗱 𝘁𝗵𝗲 𝗽𝗮𝗴𝗲𝘀, then fix them all in one pass:
Claude Code 技巧,第 2 部分:在交付一个由 vibe-coded(氛围编码)生成的网站之前,让 Opus 5.5 派出 𝟱 个子代理来检查页面背后的这 𝟮𝟱 件事,然后一次性修复所有问题:
Keys and access → Keep secret keys like your OpenAI key and Stripe secret key on the server only. Search your frontend files and git history, and replace any that show up → Check login and permissions on the server for every endpoint, and validate what users submit there too → Turn on RLS or write proper security rules for your database, so users can only read and write their own data → Keep the bucket that holds user uploads private, and share files through links that expire → Set HttpOnly and Secure on your login cookies → Keep passwords, tokens and API keys out of your logs
密钥与访问控制 → 仅将 OpenAI 密钥和 Stripe 密钥等敏感密钥保留在服务器上。搜索前端文件和 git 历史记录,替换任何出现的密钥 → 对每个端点在服务端检查登录和权限,并验证用户提交的数据 → 为数据库启用 RLS(行级安全)或编写适当的安全规则,确保用户只能读写自己的数据 → 将存储用户上传文件的 bucket 设为私有,并通过过期的链接分享文件 → 为登录 Cookie 设置 HttpOnly 和 Secure 属性 → 避免在日志中记录密码、令牌和 API 密钥
Don't let anyone run up your bill → Set spending caps or alerts on pay-per-use services like AI, SMS and email → Rate-limit sign-up, login and verification-code endpoints, and cap AI calls per user per day → Limit upload size and file types → Add a CAPTCHA to sign-up, and hold free credits until the email is verified
防止账单激增 → 为按量付费的服务(如 AI、短信和电子邮件)设置支出上限或警报 → 对注册、登录和验证码端点进行速率限制,并限制每个用户每天的 AI 调用次数 → 限制上传大小和文件类型 → 在注册时添加 CAPTCHA,并在电子邮件验证完成前暂存免费额度
Where the money comes in → Verify the signature on every payment webhook → If the same payment webhook arrives twice, record it once → Only trust amounts your server calculates → In test mode, run through a refund, a canceled subscription and a failed charge, and make sure the statuses line up → When a trial ends or a subscription lapses, remove access on time
收入来源 → 验证每个支付 webhook 的签名 → 如果收到重复的支付 webhook,只记录一次 → 仅信任服务器计算出的金额 → 在测试模式下,执行退款、取消订阅和扣款失败的操作,并确保状态一致 → 当试用期结束或订阅过期时,及时移除访问权限
When something breaks → Hook up error monitoring so you're the first to know when something fails → Back up the database daily, and restore a backup into a fresh database once to test it → Get notified when a scheduled job fails, before users notice stale data → Add an external uptime monitor that alerts you the moment the site goes down → Make sure you can ban an account that's hammering your API with one click from your admin panel
故障处理 → 接入错误监控,以便在出现故障时第一时间得知 → 每天备份数据库,并将备份恢复到新数据库中测试一次 → 在用户注意到数据陈旧之前,获取定时任务失败的通知 → 添加外部运行时间监控器,在网站宕机的瞬间发出警报 → 确保你能通过管理面板一键封禁频繁攻击你 API 的账户
Launch day → Turn off debug mode and delete test accounts and test data → Switch payments from test to live, and set up the live keys and webhook signing secret again → Turn on two-factor auth for Stripe, your hosting platform and your database dashboard → Turn on auto-renew for your domain and your HTTPS certificate → Run a security check on your dependencies (like npm audit) and upgrade anything with known vulnerabilities
上线日 → 关闭调试模式,删除测试账户和测试数据 → 将支付从测试环境切换到生产环境,并重新配置生产环境的密钥和 webhook 签名密钥 → 为 Stripe、托管平台和数据库仪表盘开启双因素认证 → 开启域名和 HTTPS 证书的自动续费 → 对你的依赖项进行安全检查(如 npm audit),并升级任何存在已知漏洞的组件
For effort, follow Anthropic's cost guide. The default medium is enough for well-scoped checks like these. The keys and payments groups are expensive to get wrong, so raise those to high. Thariq tested it: turning effort up mostly buys more verification and edge-case testing.
关于计算资源(effort)的分配,请参考 Anthropic 的成本指南。默认的中等强度足以应对此类范围明确的检查任务。由于密钥(keys)和支付组(payments groups)的配置错误代价高昂,请将它们的强度调至最高。Thariq 经过测试发现:提高计算资源主要能带来更充分的验证和边缘情况测试。
Send this whole post to Claude Code. If you need to, add this line at the end 👇 "Send one subagent per group to check it without editing anything, and note which file or dashboard each issue is in. Run the keys and payments subagents at high effort. When you find a secret, report only where it is and never paste its value. Then fix everything yourself from their lists, so no two agents edit the same file. For things I have to do in a dashboard, like rotating keys, turning on two-factor auth or setting spending caps, give me the steps and I'll do them. For things only I know, like what the caps should be or how many AI calls per day to allow, ask me first and don't make them up. Don't rewrite git history, don't touch the production database, and only test payments in test mode. Show me the list of issues first, don't change anything until I confirm, and when you're done, tell me what you changed and what's left for me to do."
将整篇文章发送给 Claude Code。如果需要,请在末尾添加以下行 👇 “为每个组发送一个子代理进行检查,过程中不编辑任何内容,并记录每个问题所在的文件或仪表板。以高计算资源运行密钥和支付组的子代理。当发现密钥时,仅报告其位置,切勿粘贴其值。然后根据它们提供的列表自行修复所有问题,确保没有两个代理编辑同一个文件。对于需要在仪表板中执行的操作(如轮换密钥、开启双因素认证或设置支出上限),请提供具体步骤,由我亲自操作。对于只有我知道的信息(如支出上限应设为多少、每天允许多少次 AI 调用等),请先询问我,不要自行编造。不要重写 git 历史记录,不要触碰生产数据库,且仅在测试模式下测试支付功能。先向我展示问题列表,在我确认之前不要进行任何更改;完成后,告诉我你修改了什么以及还剩下哪些需要我处理的事项。”
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力