AI-assisted coding tools are biased toward complexity. This changes that.
These Rules & Guidelines provide the context to deprogram the "SPA-by-default" bias in 15+ AI tools, restoring the native strengths of HTML, CSS, and server-rendered architecture.
The web has matured. Modern capabilities like View Transitions and Speculation Rules have rendered the SPA complexity tax unnecessary. These guidelines force a return to the platform capabilities that have been quietly had their enhancements perfected while the industry was distracted by frameworks.
๐ญ The Philosophy:
- MPA-First: Server-rendered architecture is the default.
- JavaScript is for enhancement, not enablement. Core functionality should work without it.
- Performance is native, not imported.
Integration: Designed for seamless integration with GitHub Copilot, Cursor, Windsurf, Gemini, Claude, Codex, and 10+ other assistants to automatically enforce MPA-first development practices.
Last Update: Dec 2025
v2 Changes:
- Major assistant-specific instruction formats added.
- New subfolder organization and integration steps (see repository structure).
- Refined wording for clarity and emphasis on the MPA-first philosophy.
AI Models are biased toward complexity. We retrain them for resilience.
For over a decade, web development has trended towards complex, JavaScript-heavy Single-Page Applications (SPAs). The promise was a slick, "app-like" user experience. The reality, in most cases, has been bloated, fragile, and over-engineered websites that are slow to load, difficult to maintain, and hostile to users and search engines.
This document outlines a return to a more resilient, performant, and durable web. We are intentionally choosing a Multi-Page Application (MPA) architecture. The guiding principle is to use the platform. We build upon the native strengths of HTML, CSS, and the browser itself, which have evolved significantly. Modern features like CSS View Transitions and Speculation Rules now provide the fluid user experience that once required megabytes of JavaScript, but without the performance penalty.
We are choosing simplicity, speed, and maintainability over unnecessary complexity. We build for users and outcomes, not for developer experience (DX) or architectural novelty. JavaScript is a powerful tool for progressive enhancement, not the default foundation for every page.
Modern AI code generation tools (like GitHub Copilot, Cursor, Claude Code, Gemini CLI, etc.) and models (Claude Sonnet/Opus, Gemini Pro, GPT-5, etc.) are primarily trained on the prevailing web development paradigm: complex, JavaScript-heavy Single-Page Applications (SPAs). This often leads to generated code that is bloated, fragile, and contrary to principles of performance, resilience, and maintainability.
This repository provides a concise set of development rules championing a Multi-Page Application (MPA) architecture. We advocate leveraging the native strengths of HTML, PHP, CSS, and the browser itself, treating JavaScript as a tool for progressive enhancement only.
Performance is native, not imported.
This approach aims for:
- Optimal Performance: Faster load times and smoother navigation.
- Enhanced Resilience: Less dependency on complex client-side logic.
- Superior Maintainability: Simpler architecture, fewer moving parts.
- Inherent SEO & Accessibility: Built upon modern web standards.
- Choose your AI assistant from the setup instructions below
- Choose your version: Strict (vanilla JS) or Relaxed (jQuery allowed)
- Copy/configure the appropriate file for your tool
- Start coding with MPA-First principles enforced by your AI assistant
Each AI assistant has two versions of the MPA guidelines:
- Strict Rules - Vanilla JavaScript ES2020+ only, no libraries or frameworks
- Relaxed Rules - Allows jQuery for progressive enhancement
Choose the version that best fits your project requirements.
First, clone this repository to get all the MPA-First guideline files:
git clone https://github.com/RealistSec/mpa-first-guidelines.git
cd mpa-first-guidelinesExpand for GitHub Copilot in VS Code
1. Copy the appropriate agent file to `.github/agents/` in your project root:# For strict rules
cp mpa-strict-agent.md .github/agents/mpa-strict-agent.md
# For relaxed rules (jQuery allowed)
cp mpa-relaxed-agent.md .github/agents/mpa-relaxed-agent.md-
Add a reference to the agent file in your
.github/copilot-instructions.md(create the file if it doesn't exist):# MPA-First Guidelines Reference For MPA-first development guidelines, reference the agent file: - Strict rules: @mpa-strict-agent - Relaxed rules: @mpa-relaxed-agent This ensures GitHub Copilot uses MPA-first principles throughout your project.
If
.github/copilot-instructions.mdalready contains custom instructions, append the agent reference instead of overwriting.
For GitHub Copilot CLI setup
-
clone this repo or copy the appropriate agent file to your project:
# For strict rules place the file cp .github/agents/mpa-strict-agent.md .github/agents/mpa-strict-agent.md # For relaxed rules cp .github/agents/mpa-relaxed-agent.md .github/agents/mpa-relaxed-agent.md
The agent files are now in place in .github/agents/
2. To use the coding agent:
# For strict rules
gh copilot agent @mpa-strict-agent
# For relaxed rules (jQuery)
gh copilot agent @mpa-relaxed-agent
# To remove all instruction sets Expand for Cursor IDE setup
- The rules are already in place in
.cursor/rules/ - Cursor will automatically detect and use these
.mdcfiles - Choose which rule to apply:
- Strict: Use
mpa-strict-rules.mdc(always applied) - Relaxed: Use
mpa-relaxed-rules.mdc(manually applied with@mpa-relaxed-rules)
- Strict: Use
Expand for Windsurf IDE setup
-
Copy the appropriate file to your project root:
# For strict rules (overwrites existing) cp .windsurf/mpa-strict-rules.md .windsurfrules # For relaxed rules (appends, preserves existing) cat .windsurf/mpa-relaxed-rules.md >> .windsurfrules # Or, on Windows/PowerShell: Get-Content .windsurf/mpa-relaxed-rules.md | Add-Content .windsurfrules
If
.windsurfrulesalready contains custom instructions, append new rules instead of overwriting. -
Or edit workspace rules via: Settings > Set Workspace AI Rules > Edit Rules
Expand for Gemini CLI setup
-
Copy the appropriate file to your Gemini CLI context directory:
# For strict rules (overwrites existing) cp .gemini/GEMINI-MPA-STRICT.md ~/.gemini/GEMINI.md # For relaxed rules (appends, preserves existing) cat .gemini/GEMINI-MPA-RELAXED.md >> ~/.gemini/GEMINI.md # Or, on Windows/PowerShell: Get-Content .gemini/GEMINI-MPA-RELAXED.md | Add-Content ~/.gemini/GEMINI.md
If
GEMINI.mdalready contains custom instructions, append new rules instead of overwriting. -
Or place at project root:
.gemini/GEMINI.md
Expand for Claude Desktop/Projects setup
- Open your Claude Project settings
- Copy the content from the appropriate file:
- Strict:
.claude/mpa-strict-instructions.md - Relaxed:
.claude/mpa-relaxed-instructions.md
- Strict:
- Paste into the "Custom Instructions" section of your Claude Project.
If you already have custom instructions, merge the new rules with your existing contentโdo not overwrite.
Expand for Claude Code CLI setup
-
Copy the appropriate file to your project root as
CLAUDE.md:# For strict rules cp claude-code/CLAUDE-MPA-STRICT.md CLAUDE.md # For relaxed rules (jQuery allowed) cp claude-code/CLAUDE-MPA-RELAXED.md CLAUDE.md
-
Claude Code will automatically read
CLAUDE.mdfrom your project root.
Expand for OpenAI Codex CLI setup
-
Copy the appropriate file to your project root as
AGENTS.md:# For strict rules cp openai-codex/AGENTS-MPA-STRICT.md AGENTS.md # For relaxed rules (jQuery allowed) cp openai-codex/AGENTS-MPA-RELAXED.md AGENTS.md
-
OpenAI Codex will automatically read
AGENTS.mdfrom your project root.
Expand for Cline setup
-
Copy the appropriate file to your project root:
# For strict rules cp .cline/mpa-strict.md .clinerules # For relaxed rules (jQuery allowed) cp .cline/mpa-relaxed.md .clinerules
-
Or create a
.clinerules/directory for multiple rule files.
Expand for Roo Code setup
-
Copy the rules to your project:
# For strict rules mkdir -p .roo/rules cp .roo/rules/mpa-strict.md .roo/rules/ # For relaxed rules (jQuery allowed) mkdir -p .roo/rules cp .roo/rules/mpa-relaxed.md .roo/rules/
-
Or use a single
.roorulesfile in your project root.
Expand for JetBrains AI Assistant setup
- Open your JetBrains IDE (IntelliJ IDEA, WebStorm, PhpStorm, etc.)
- Go to Settings โ Tools โ AI Assistant โ Prompt Library
- Copy prompts from
jetbrains-ai/mpa-prompts.md - Add them to your prompt library
Expand for other AI assistants setup
Copy the appropriate instructions file to your project and configure according to each tool's documentation:
- Augment Code:
augment-code/mpa-strict.mdormpa-relaxed.md - Kilo Code:
kilo-code/mpa-strict.mdormpa-relaxed.md - Kiro:
kiro/mpa-strict.mdormpa-relaxed.md - Qwen Coder:
qwen-coder/mpa-strict.mdormpa-relaxed.md
Expand for system prompt-based tools setup
- Copy the content from the appropriate file:
- Strict:
system-prompts/mpa-strict-system-prompt.md - Relaxed:
system-prompts/mpa-relaxed-system-prompt.md
- Strict:
- Paste as your system prompt or custom instructions in the platform's settings.
Expand for GPT-5/OpenAI Codex setup
- Copy the content from the appropriate file:
- Strict:
GPT-5_and_GPT-5-Codex/mpa-strict-system-prompt.md - Relaxed:
GPT-5_and_GPT-5-Codex/mpa-relaxed-system-prompt.md
- Strict:
- Use as your system prompt in:
- ChatGPT Custom GPT instructions
- OpenAI API system message
- Any GPT-4 based coding assistant configuration
- Any GPT-5 based coding as assistant configuration
If you already have custom instructions, merge the new rules with your existing contentโdo not overwrite.
Quick cleanup: After cloning, you can remove unneeded assistant folders with:
# Unix/Linux/macOS/Windows(Current version) (Bash/Zsh/PowerShell 7.4+) - Keep only what you need, remove the rest
rm -r -force .cursor/ .windsurf/ .gemini/ .claude/ GPT-5_and_GPT-5-Codex/ .github/ This repository contains MPA-First guidelines formatted specifically for each major AI coding assistant:
mpa-first-guidelines/
โ
โโโ .github/ # GitHub Copilot (Source of Truth)
โ โโโ agents/
โ โ โโโ mpa-strict-agent.md # Copilot Coding Agent (strict)
โ โ โโโ mpa-relaxed-agent.md # Copilot Coding Agent (relaxed)
โ โโโ copilot-instructions.md # Copilot IDE instructions
โ
โโโ .cursor/ # Cursor IDE
โ โโโ rules/
โ โโโ mpa-strict-rules.mdc # .mdc format (strict)
โ โโโ mpa-relaxed-rules.mdc # .mdc format (relaxed)
โ
โโโ .windsurf/ # Windsurf IDE
โ โโโ mpa-strict-rules.md # .windsurfrules format (strict)
โ โโโ mpa-relaxed-rules.md # .windsurfrules format (relaxed)
โ
โโโ .gemini/ # Gemini CLI
โ โโโ GEMINI-MPA-STRICT.md # GEMINI.md format (strict)
โ โโโ GEMINI-MPA-RELAXED.md # GEMINI.md format (relaxed)
โ
โโโ .claude/ # Claude Desktop/Projects
โ โโโ mpa-strict-instructions.md # Custom instructions (strict)
โ โโโ mpa-relaxed-instructions.md # Custom instructions (relaxed)
โ
โโโ .cline/ # Cline
โ โโโ mpa-strict.md # .clinerules format (strict)
โ โโโ mpa-relaxed.md # .clinerules format (relaxed)
โ
โโโ .roo/ # Roo Code
โ โโโ rules/
โ โโโ mpa-strict.md # .roorules format (strict)
โ โโโ mpa-relaxed.md # .roorules format (relaxed)
โ
โโโ claude-code/ # Claude Code CLI
โ โโโ CLAUDE-MPA-STRICT.md # CLAUDE.md format (strict)
โ โโโ CLAUDE-MPA-RELAXED.md # CLAUDE.md format (relaxed)
โ
โโโ openai-codex/ # OpenAI Codex CLI
โ โโโ AGENTS-MPA-STRICT.md # AGENTS.md format (strict)
โ โโโ AGENTS-MPA-RELAXED.md # AGENTS.md format (relaxed)
โ
โโโ GPT-5_and_GPT-5-Codex/ # GPT-5/ChatGPT
โ โโโ mpa-strict-system-prompt.md # System prompt (strict)
โ โโโ mpa-relaxed-system-prompt.md # System prompt (relaxed)
โ
โโโ jetbrains-ai/ # JetBrains AI Assistant
โ โโโ mpa-prompts.md # Prompt library templates
โ
โโโ augment-code/ # Augment Code
โ โโโ mpa-strict.md # Instructions (strict)
โ โโโ mpa-relaxed.md # Instructions (relaxed)
โ
โโโ kilo-code/ # Kilo Code
โ โโโ mpa-strict.md # Rules (strict)
โ โโโ mpa-relaxed.md # Rules (relaxed)
โ
โโโ kiro/ # Kiro
โ โโโ mpa-strict.md # Instructions (strict)
โ โโโ mpa-relaxed.md # Instructions (relaxed)
โ
โโโ qwen-coder/ # Qwen Coder
โ โโโ mpa-strict.md # Instructions (strict)
โ โโโ mpa-relaxed.md # Instructions (relaxed)
โ
โโโ system-prompts/ # Generic System Prompts
โ โโโ mpa-strict-system-prompt.md # For Bolt.new, Lovable, V0.app, Replit
โ โโโ mpa-relaxed-system-prompt.md # For Bolt.new, Lovable, V0.app, Replit
โ
โโโ mpa-rules.md # Original strict rules
โโโ mpa-relaxed-rules.md # Original relaxed rules (jQuery)
โโโ README.md
mpa-rules.md- Original comprehensive strict rulesmpa-relaxed-rules.md- Original relaxed rules with jQuery
These documents contain the full, detailed guidelines. The assistant-specific versions are formatted adaptations of these core rules.
These rules were heavily inspired by the insightful perspectives of Jono Alderson, particularly his compelling blog post, "It's Time for Modern CSS to Kill the SPA", which we discovered via the TLDR Newsletter.
Jono's work deeply resonates with my aim for a more resilient and performant web. We also recommend his equally thought-provoking piece, "JavaScript Broke The Web And Called It Progress", for further reading on the philosophy behind building a better web.
Also the tweet that triggered my curiosity into non-SPA - "@levelsio not knowing what state is in react."
One day I plan to make a companion doc: "Landscape of PHP" - a concise orientation debunking the "PHP is dying" myth (it still powers ~74% of the known server-side of the web /2025) and mapping its vibrant subcultures (WordPress pragmatists, Laravel evangelists, strict type/standards purists) to contextualize architectural choices.
These rules are a living document. We welcome suggestions, improvements, and discussions.
This project is open-sourced under the MIT License. See the LICENSE file for more details.