AI SummaryPageFlash provides AI agents and GitHub Copilot with comprehensive WordPress plugin development guidelines covering coding standards, security, accessibility, and best practices to ensure high-quality, standards-compliant plugin code.
Install
Copy this and paste it into Claude Code, Cursor, or any AI assistant:
I want to add the "pageflash — Copilot Instructions" prompt rules to my project. Repository: https://github.com/theaminulai/pageflash Please read the repo to find the rules/prompt file, then: 1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type) 2. If there's an existing rules file, merge the new rules in rather than overwriting 3. Confirm what was added
Description
PageFlash is a powerful WordPress plugin that preloads pages intelligently to boost site speed and enhance user experience. By loading pages before users click, PageFlash ensures instant page transitions, creating a seamless and lightning-fast browsing experience for your visitors.
WordPress Plugin Development Guidelines for AI Agents
This document provides comprehensive instructions for AI agents, GitHub Copilot, and automated coding tools when working with WordPress plugin development. Follow these guidelines to ensure code quality, security, accessibility, and adherence to WordPress standards. ---
1.1 PHP Coding Standards
• Follow WordPress PHP Coding Standards • Use Yoda conditions for comparisons: if ( true === $condition ) • Use tabs for indentation, not spaces • Opening braces { should be on the same line as the statement • Use elseif, not else if • Space after control structures: if ( condition ) {, foreach ( $array as $item ) { • Use single quotes for strings unless variable interpolation or special characters are needed • Always use full PHP opening tags <?php, never short tags <? • Add trailing commas in multi-line arrays for better version control diffs Example: `php <?php if ( true === $is_active ) { foreach ( $items as $item ) { echo esc_html( $item['name'] ); } } `
1.2 JavaScript Coding Standards
• Follow WordPress JavaScript Coding Standards • Use tabs for indentation • Use const and let, avoid var • Use camelCase for variable and function names • Use single quotes for strings • Add semicolons at the end of statements • Use strict equality operators: === and !== • Use jQuery wrapped in IIFE when working with WordPress: ( function( $ ) { ... } )( jQuery ); • For modern React/Block development, follow ES6+ standards Example: `javascript // jQuery example ( function( $ ) { 'use strict'; const handleClick = function( event ) { event.preventDefault(); const $target = $( event.target ); // Logic here }; $( document ).ready( handleClick ); } )( jQuery ); // JavaScript ES6+ example const initializeApp = () => { const elements = document.querySelectorAll( '.my-element' ); elements.forEach( ( element ) => { element.addEventListener( 'click', ( event ) => { event.preventDefault(); const { dataset } = event.currentTarget; console.log( dataset.value ); } ); } ); }; document.addEventListener( 'DOMContentLoaded', initializeApp ); `
1.3 CSS Coding Standards
• Follow WordPress CSS Coding Standards • Use tabs for indentation • Use lowercase for selectors and properties • Use shorthand properties where possible • Add space after colons: property: value; • Use single line for single declarations, multiple lines for multiple declarations • Include vendor prefixes when necessary (use autoprefixer) • Avoid ID selectors for styling; use classes instead Example: `css .wp-block-custom { display: flex; align-items: center; padding: 1rem; background-color: #fff; } `
Discussion
Health Signals
My Fox Den
Community Rating
Sign in to rate this booster
Works With
Any AI assistant that accepts custom rules or system prompts