mpa-first-guidelines
Copilot instructions11 starsChanged 12 months agoMITView on GitHub
This is a reference documentation repository containing MPA (Multi-Page Application) development guidelines for AI coding agents. Users copy these guidelines into their own projects to teach AI tools (GitHub Copilot, Cursor, Claude, Codex, etc.) to generate MPA-first code instead of defaulting to SPA frameworks. Base rule files: - mpa-rules.md - Comprehensive, strict MPA-first mandate with strict PHP & vanilla JS only. This is the primary reference document. Assistant-specific base instruction files: - .github/agents/mpa-strict-agent.md - Copilot agent-specific instructions file based on…
In this repository2 other files it gives its agents.
- .cursor/rules/mpa-relaxed-rules.mdcCursor rule
- .cursor/rules/mpa-strict-rules.mdcCursor rule
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
17 rules. About 0 are common, 16 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
When editing these guidelines:
- Distinctive: line 26
Be authoritative and prescriptive: - Use "MUST" and "DO NOT" language.
- Distinctive: line 27
Provide concrete examples: - Every principle should have a code snippet showing the correct pattern.
- Distinctive: line 35
Keep examples realistic: - Use patterns that would appear in actual projects
- Distinctive: line 38
Update the table of contents: - If you add major sections, ensure navigation is clear
- Distinctive: line 45
Update agent files in parallel: - When modifying base rule files, ensure corresponding assistant-specific files are updated to maintain …
- Distinctive: line 49
Markdown formatting: - All rule files use standard markdown with fenced code blocks
- Distinctive: line 51
Git-friendly: - Keep line lengths reasonable for clean diffs
- Distinctive: line 60
SEO & accessibility by default: - Not bolted on as afterthoughts
- Distinctive: line 76
If a user wants to add content:
- Distinctive: line 77
Ask what problem they're solving
- Distinctive: line 78
Ensure it aligns with MPA-first principles
- Distinctive: line 79
Add concrete examples, not abstract advice
- Distinctive: line 80
Update both variants if applicable
- Distinctive: line 82
If a user wants to make rules more lenient:
- Distinctive: line 83
Consider whether it compromises the MPA architecture (banned)
- Very specific: line 88
Use semantic HTML examples: - Always show proper <header>, <main>, <article>, etc.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot Instructions: MPA-First Guidelines Repository
Repository Purpose
This is a reference documentation repository containing MPA (Multi-Page Application) development guidelines for AI coding agents. Users copy these guidelines into their own projects to teach AI tools (GitHub Copilot, Cursor, Claude, Codex, etc.) to generate MPA-first code instead of defaulting to SPA frameworks.
Key Files & Their Roles
Base rule files:
mpa-rules.md- Comprehensive, strict MPA-first mandate with strict PHP & vanilla JS only. This is the primary reference document.mpa-relaxed-rules.md- Variant ruleset allowing full use of PHP & jQuery for progressive enhancement while maintaining MPA architecture.
Assistant-specific base instruction files:
.github/agents/mpa-strict-agent.md- Copilot agent-specific instructions file based onmpa-rules.mdfor strict MPA adherence..github/agents/mpa-relaxed-agent.md- Copilot agent-specific instructions file based onmpa-relaxed-rules.mdfor a more lenient MPA approach.
Documentation:
README.md- User-facing documentation explaining the problem, solution, and how to integrate these rules into AI coding workflows.
Writing Style & Tone
When editing these guidelines:
- Be authoritative and prescriptive - Use "MUST" and "DO NOT" language. These are rules, not suggestions.
- Provide concrete examples - Every principle should have a code snippet showing the correct pattern.
- Explain the "why" - Help developers understand the philosophy, not just the mechanics.
- Stay opinionated - The entire premise is rejecting the SPA-default paradigm. Don't hedge or equivocate.
Content Maintenance Patterns
Adding New Rules or Sections
- Keep examples realistic - Use patterns that would appear in actual projects
- Maintain parallelism - Both
mpa-rules.*with.github/agents/mpa-strict-agent.mdandmpa-relaxed-rules.*with.github/agents/mpa-relaxed-agent.mdshould cover the same topics in the same order - Update the table of contents - If you add major sections, ensure navigation is clear
Updating Existing Content
- Preserve the document structure - The current flow (Prime Directive → HTML → CSS → PHP → JS → Security) is intentional
- Keep code examples modern - Target current 2025-26 web standards (PHP 8.1+, ES2020+, modern CSS)
- Maintain accessibility focus - A11Y is not optional in these guidelines
- Update agent files in parallel - When modifying base rule files, ensure corresponding assistant-specific files are updated to maintain consistency, keeping them concise and directive for AI prompts
Technical Constraints
- Markdown formatting - All rule files use standard markdown with fenced code blocks
- No dependencies - This is a pure documentation repository with no build tools or runtime
- Git-friendly - Keep line lengths reasonable for clean diffs
Philosophy to Preserve
This repository champions:
- Platform-first thinking - HTML, CSS, PHP, and browser APIs over JavaScript frameworks
- Progressive enhancement - Core functionality works without JS
- Performance as a feature - Fast load times from server-rendered HTML
- SEO & accessibility by default - Not bolted on as afterthoughts
- Simplicity over novelty - Boring, proven technology over the latest trends
Common Edits & How to Handle Them
"Should we add framework X?"
No. If it's a client-side SPA framework (React, Vue, Svelte, etc.), it's explicitly banned. Even if "everyone uses it."
"Can we include framework-based SSR?"
No. Next.js, Nuxt, SvelteKit, etc. are still SPA architectures at their core. True MPAs use traditional server-side rendering (PHP, Node.js + templates, Ruby, Python, etc.).
"What about Htmx/Alpine.js/other minimal JS libraries?"
These could be mentioned as acceptable enhancement tools since they embrace progressive enhancement, but only in the relaxed variant. The strict mpa-rules.md stays vanilla-only.
When Users Request Changes
If a user wants to add content:
- Ask what problem they're solving
- Ensure it aligns with MPA-first principles
- Add concrete examples, not abstract advice
- Update both variants if applicable
If a user wants to make rules more lenient:
- Consider whether it compromises the MPA architecture (banned)
- Or just adds a helpful tool for enhancement (potentially allowed in relaxed variant)
Documentation Standards
- Use semantic HTML examples - Always show proper
<header>,<main>,<article>, etc. - Include accessibility attributes -
alttext,aria-label, proper<label>associations - Show security patterns - CSRF tokens, parameterized queries, CSP headers
- Demonstrate modern CSS - Grid, Flexbox, Custom Properties, View Transitions
Adapting for Different AI Assistants
When integrating these guidelines into other AI tools (e.g., Cursor, Claude, Codex), prioritize the assistant-specific files (e.g., .github/agents/mpa-strict-agent.md) as the primary source of truth for prompts. These are condensed and directive, making them ideal for AI consumption. Fork and customize them for the target assistant's format, maintaining parallelism with the base rule files. Test integrations to ensure strict adherence to MPA principles and progressive enhancement.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

