回到資源中心
DevOps Prompt Library
不知道怎麼問 AI 才能解決部署錯誤?
這裡有我們測試過最有效的「咒語」,直接複製貼上給與您協作的 AI (ChatGPT/Claude/Cursor)。
分析 Vercel Build Error
Vercel
Build Fail
Next.js
當部署失敗且 Log 看不懂時,用這個 Prompt 讓 AI 幫你翻譯並找出關鍵錯誤。
I am encountering a build error on Vercel with my Next.js project. Here is the build log output: ``` [PASTE BUILD LOG HERE] ``` Here is my `package.json`: ```json [PASTE PACKAGE.JSON HERE] ``` Please analyze the log and tell me: 1. What is the specific error causing the build to fail? 2. Is this related to a missing dependency, a type error, or an environment variable? 3. What exact steps (command line or code change) should I verify to fix this?
撰寫安全的 Supabase RLS
Supabase
Security
RLS
請 AI 幫你寫 Policy 時,務必加上這些限制條件,避免它寫出 `USING(true)`。
I need to write a Row Level Security (RLS) policy for a Supabase table named "[TABLE_NAME]". Requirement: - Users can only read their own data (where user_id matches auth.uid()). - Users can insert rows but user_id must automatically allow the authenticated user. - [ADD_OTHER_REQUIREMENTS] CRITICAL SECURITY RULES: 1. Do NOT use "USING (true)" or "WITH CHECK (true)". 2. Ensure the policy specifically references "auth.uid()". 3. Provide the SQL command to enable RLS first. Please generate the SQL for this policy.
檢查環境變數缺漏
Env Vars
Config
讓 AI 掃描你的程式碼,列出所有需要設定到 Vercel 的環境變數。
Please scan the following code snippets and identify all environment variables used (e.g., process.env.VAR_NAME). Code: ```javascript [PASTE CODE SNIPPETS HERE] ``` Output format: 1. List of found environment variables. 2. For each variable, guess if it should be a secret (like API keys) or public (like NEXT_PUBLIC_). 3. Generate a template `.env.local` file content.
優化 Next.js Dockerfile
Docker
Deployment
不僅能跑,還要讓 Image 更小、更安全。
Here is my current Dockerfile for a Next.js application. ```dockerfile [PASTE DOCKERFILE] ``` Please optimize this Dockerfile for production: 1. Use multi-stage builds (deps, builder, runner). 2. Use "standalone" output mode to reduce image size. 3. Ensure it runs as a non-root user (security). 4. Explain the changes you made.
這些 Prompts 針對 GPT-4 與 Claude 3.5 Sonnet 優化。如果您有更好的指令,歡迎來信分享!