// 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.
Me pēhea te mahi
E rua ngā wāhanga raraunga ka hono i te pāwhiri:
- Te finding — title, description, evidence, remediation, CWE — kua utaina kē ki te report.
- Te framework o tō codebase — ka kitea mai i ngā findings
discovery.tech-fingerprinto te scan (Next.js, React, Vue, Django, Express, Rails, Laravel, Flask). Ka hoki ki tētahi generic recipe ina kāore he framework e kitea (kātahi ka tono te agent prompt ki te LLM kia kite i te 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.
Te āhua o te 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.
Ngā framework e tautokona ana
Ka whakaatu mātou i ngā framework-specific snippets mō:
- Next.js, React, Vue, Nuxt, Svelte (frontend)
- Express, Fastify (Node.js backend)
- Django, Flask (Python)
- Ruby on Rails
- Laravel (PHP)
- ASP.NET Core (kua whakamaheretia, ka fallback ki generic i tēnei rā)
He best-effort te framework detection. Ka sniff mātou i ngā tag __NEXT_DATA__, __NUXT__, hash cookies (laravel_session), headers X-Powered-By, me ētahi atu signals. Ki te whakahaere koe i tētahi custom framework, ka hoki te prompt ki te generic recipe, ā, mā te agent e kimi mai i tō package.json.
Whakamahia mai i tō AI agent
Mēnā kua hono koe i te MCP server, ka whakaaturia taua prompt anō hei slash command. Mai i 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.
He aha mātou kāore ai e pā ki Claude ia pāwhiri
I te whakarewatanga i whakaaro mātou ki te karanga i te Anthropic API mō ia pāwhiri kia whakapai ake i te prompt me te codebase context. Kāore mātou i pērā, nā te mea:
- Ko te agent ka whakapirihia e te kaiwhakamahi ki roto kua whai kē i te codebase context — kei te whakamahi rātou i Cursor / Claude Desktop me tō rātou repo e tuwhera ana.
- Ka hipoki te templating ia-(check × framework) i te ~80% o te uara me te kore utu ia pāwhiri.
- Ka taea e tētahi opt-in “Refine with AI for my codebase” te whakakā i te API ā muri ake mēnā e hiahia ana ngā kaiwhakamahi. I tēnei rā, kāo.
