Skip to content

Prompt Generation

PerfLeaf generates a rich, structured prompt from every Action Plan that can be pasted directly into an AI coding agent such as Cursor, Windsurf, GitHub Copilot, or Claude.

From a Page Report or Action Plan, click View AI Coding Agent Prompt. This opens the prompt page at /dashboard/action-plans/[id]/prompt.

The prompt page offers three views, switchable via tabs:

FormatBest forDescription
ReadableHumans / general AI chatMarkdown-rendered with headings, lists, and code blocks
XMLCursor / Windsurf rules filesStructured XML tags optimised for IDE-integrated agents
JSONProgrammatic use / APIsRaw JSON of the AIAgentPrompt object
  • Page URL and detected tech stack
  • Resource summary (JS, CSS, image, total sizes; script count; CO₂/visit)
  • Metric failures (which Core Web Vitals fail thresholds)
  • Head summary (title, description, canonical from <head>)
  • Performance score and category grades
  • Security issues summary
  • DOM complexity summary
  • GEO analysis summary
  • SEO metadata status
  • AI agent accessibility (robots.txt, llms.txt presence)
  • Regressions (metrics that degraded vs. previous report)

Each task includes:

  • Priority rank, issue category, and measurable goal
  • Technical objective and performance target
  • Constraints and acceptance criteria
  • DOM selectors (when available)
  • Regression risks
  • Remediation actions (step-by-step)
  • AI hints with code examples
  • Learn-more reference URL

Project-wide constraints the agent must respect (e.g. “Do not remove existing functionality”).

Quantified targets the agent should achieve (e.g. “LCP ≤ 2.5s”).

Click Copy to Clipboard to copy the currently active view. You can then paste it into:

  • Cursor — paste into chat or add to .cursorrules
  • Windsurf — paste into cascade or .windsurfrules
  • GitHub Copilot — use as a chat instruction
  • Claude / ChatGPT — paste as the first message
  • Any other AI assistant that accepts natural-language instructions

A toast notification confirms the copy was successful.

To get an updated prompt after a new scan:

  1. Run a new scan on the site.
  2. Navigate to the new page report.
  3. Click Generate Action Plan to create a fresh plan with the latest data.