// 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.
Kif jaħdem
Żewġ biċċiet data jingħaqdu fuq click:
- Il-finding — titlu, deskrizzjoni, evidence, remediation, CWE — diġà loaded mar-rapport.
- Il-framework tal-codebase tiegħek — detected mill-findings
discovery.tech-fingerprinttal-scan (Next.js, React, Vue, Django, Express, Rails, Laravel, Flask). Jaqa' lura għal riċetta ġenerika meta ma jinstab l-ebda framework (l-agent prompt imbagħad jitlob lill-LLM jindividwah mill-istat tar-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.
Kif jidher il-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 appoġġjati
Nuru snippets speċifiċi għal framework għal:
- Next.js, React, Vue, Nuxt, Svelte (quddiem)
- Express, Fastify (backend Node.js)
- Django, Flask (Python)
- Ruby on Rails
- Laravel (PHP)
- ASP.NET Core (ippjanat, fallback għal generic illum)
Framework detection huwa best-effort. Inxommu tags __NEXT_DATA__, __NUXT__, hash cookies (laravel_session), headers X-Powered-By, u ftit signals oħra. Jekk qed tħaddem framework custom, il-prompt jaqa' lura għar-riċetta ġenerika u l-agent jifhmu mill-package.json tiegħek.
Użah mill-agent AI tiegħek
Jekk qabbadt is-server MCP, l-istess prompt huwa espost bħala slash command. Minn 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.
Għaliex ma nsejħux lil Claude għal kull click
Fit-tnedija kkunsidrajna li nsejħu l-Anthropic API għal kull click biex nirfinaw il-prompt b'kuntest tal-codebase. Ma għamilniex hekk, għax:
- L-agent li l-utent iwaħħal fih diġà għandu kuntest tal-codebase — qed juża Cursor / Claude Desktop bir-repo tiegħu miftuħ.
- Templating għal kull (check × framework) ikopri madwar 80% tal-valur mingħajr ebda spiża għal kull click.
- Opt-in “Refine with AI for my codebase” jista' jqabbad l-API aktar tard jekk l-utenti jriduh. Illum, le.
