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.
How to reach it
Section titled “How to reach it”From a Page Report or Action Plan, click View AI Coding Agent Prompt. This opens the prompt page at /dashboard/action-plans/[id]/prompt.
Output formats
Section titled “Output formats”The prompt page offers three views, switchable via tabs:
| Format | Best for | Description |
|---|---|---|
| Readable | Humans / general AI chat | Markdown-rendered with headings, lists, and code blocks |
| XML | Cursor / Windsurf rules files | Structured XML tags optimised for IDE-integrated agents |
| JSON | Programmatic use / APIs | Raw JSON of the AIAgentPrompt object |
What the prompt contains
Section titled “What the prompt contains”Context section
Section titled “Context section”- 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)
Prioritised tasks
Section titled “Prioritised tasks”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
Global constraints
Section titled “Global constraints”Project-wide constraints the agent must respect (e.g. “Do not remove existing functionality”).
Success metrics
Section titled “Success metrics”Quantified targets the agent should achieve (e.g. “LCP ≤ 2.5s”).
Copying the prompt
Section titled “Copying the prompt”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.
Regenerating
Section titled “Regenerating”To get an updated prompt after a new scan:
- Run a new scan on the site.
- Navigate to the new page report.
- Click Generate Action Plan to create a fresh plan with the latest data.