FixWeb

// docs / ai fix prompts

AI improvement prompts

Every finding has a Copy prompt button beneath the remediation. Click it, paste into Claude / Cursor / Copilot, and the agent gets the canonical improvement recipe for that website-quality issue — no Claude API call from us.

運作方式

點擊時會結合兩份資料:

  • 發現項目:標題、描述、證據、修復建議、CWE,已隨報告載入。
  • 你的程式碼框架:從掃描的 discovery.tech-fingerprint 發現項目偵測(Next.js、React、Vue、Django、Express、Rails、Laravel、Flask)。如果偵測不到框架,就退回通用配方(agent prompt 接著會要求 LLM 從 repo state 偵測)。

Templates live in lib/scanner/fix-prompts.ts. The registry has check-specific guidance for crawlability, search presentation, semantic content, structured data, media, performance, accessibility, forms, mobile/i18n, runtime, owner journeys, and repo-quality issues. For everything else, the existing remediation field on the finding becomes the generic recipe.

提示長什麼樣

Fix the "Hero image is lazy-loaded and missing dimensions" finding on /pricing.

Issue: The largest above-the-fold image is marked loading="lazy" and has
no explicit width/height. That can delay LCP and create layout shift.

Codebase context: Next.js.

Recommended fix:
Use next/image or the existing image component with explicit width/height,
responsive sizes, meaningful alt text, and priority/fetchPriority for the
first major visual on the page.

Constraints:
- Don't break existing tests; run the test suite after the change.
- Match the codebase's existing style and lint config.
- Add a brief comment explaining the performance reasoning only where the
  fix would otherwise look arbitrary.
- If the fix needs a new dependency, install it via the project's
  package manager (npm / pnpm / pip / bundle / composer).

Reference: Core Web Vitals / Largest Contentful Paint guidance.

支援的框架

我們會針對以下框架提供特定片段:

  • Next.js、React、Vue、Nuxt、Svelte(frontend)
  • Express、Fastify(Node.js backend)
  • Django、Flask(Python)
  • Ruby on Rails
  • Laravel(PHP)
  • ASP.NET Core(規劃中,目前退回通用配方)

框架偵測是 best-effort。我們會嗅探 __NEXT_DATA__ tags、__NUXT__、hash cookies(laravel_session)、X-Powered-By headers,以及其他幾種訊號。如果你使用自訂框架,提示會退回通用配方,agent 會從你的 package.json 判斷。

從你的 AI agent 使用

如果你已經接好 MCP 伺服器,同一份提示也會以 slash command 形式公開。從 Claude Desktop:

/fixweb-fix finding_id=550e8400-e29b-41d4-a716-446655440000

The renderer looks up the finding, detects the framework from the parent scan when available, renders the templated prompt, and injects it into your conversation as the user message. No round-trip to our Claude API; templates are pure and free.

為什麼我們不在每次點擊時呼叫 Claude

推出前,我們曾考慮每次點擊都呼叫 Anthropic API,用 codebase context 精煉提示。最後沒有這麼做,原因是:

  • 使用者貼入的 agent 已經有 codebase context:他們是在開著 repo 的 Cursor / Claude Desktop 裡使用。
  • 依(check × framework)做範本化,能在沒有每次點擊成本的情況下涵蓋約 80% 價值。
  • 未來可以加入「Refine with AI for my codebase」的 opt-in,讓想要的使用者再觸發 API。今天不會。
AI improvement prompts — Docs · FixWeb