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.

ทำงานอย่างไร

ข้อมูลสองส่วนรวมกันเมื่อคลิก:

  • Finding — title, description, evidence, remediation, CWE — โหลดพร้อมรายงานแล้ว
  • Framework ของ codebase คุณ — ตรวจจาก findings discovery.tech-fingerprint ของ scan (Next.js, React, Vue, Django, Express, Rails, Laravel, Flask) หากตรวจไม่พบ framework จะ fallback เป็นสูตรทั่วไป (จากนั้น agent prompt จะขอให้ LLM ตรวจจากสถานะ repo)

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.

Prompt หน้าตาเป็นอย่างไร

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.

Frameworks ที่รองรับ

เราแสดง snippets เฉพาะ framework สำหรับ:

  • Next.js, React, Vue, Nuxt, Svelte (frontend)
  • Express, Fastify (Node.js backend)
  • Django, Flask (Python)
  • Ruby on Rails
  • Laravel (PHP)
  • ASP.NET Core (วางแผนแล้ว, ตอนนี้ fallback เป็น generic)

การตรวจ framework เป็นแบบ best-effort เรา sniff tags __NEXT_DATA__, __NUXT__, hash cookies (laravel_session), headers X-Powered-By และสัญญาณอื่นเล็กน้อย หากคุณใช้ custom framework, prompt จะ fallback เป็นสูตร generic และ agent จะหาคำตอบจาก package.json ของคุณ

ใช้จาก AI agent ของคุณ

หากคุณเชื่อมต่อ MCP server แล้ว prompt เดียวกันนี้จะเปิดเป็น 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 ต่อคลิกเพื่อปรับ prompt ด้วยบริบท codebase แต่เราไม่ได้ทำ เพราะ:

  • Agent ที่ผู้ใช้วาง prompt เข้าไป มีบริบท codebase อยู่แล้ว — พวกเขาใช้ Cursor / Claude Desktop โดยเปิด repo ไว้
  • Templating ต่อ (check × framework) ครอบคลุมคุณค่าประมาณ 80% โดยไม่มีต้นทุนต่อคลิก
  • ตัวเลือก “Refine with AI for my codebase” อาจเรียก API ภายหลังถ้าผู้ใช้ต้องการ วันนี้ยังไม่ทำ
AI improvement prompts — Docs · FixWeb