moodle-standards

Enforce Moodle coding standards on PHP code in plugin directories.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/astoeffer/plugin-marketplace --skill moodle-standards
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moodle-standards
Source: https://github.com/astoeffer/plugin-marketplace/tree/main/plugins/moodle-dev-pro/skills/moodle-standards
Command: npx skills add https://github.com/astoeffer/plugin-marketplace --skill moodle-standards

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforces Moodle coding standards (PSR-12 with Moodle exceptions) to improve PHP code quality, readability, and collaboration.

Core Features & Use Cases

  • PSR-12 with Moodle exceptions: Naming, prefixes, and structure tailored for Moodle.
  • PHPDoc & Type Hints: Enforces documentation and explicit types.
  • Validation & Quick Fixes: Provides guidance and automated fixes for common violations.

Quick Start

Run Moodle-specific checks on PHP files in a Moodle plugin to validate style and structure. Example: vendor/bin/phpcs --standard=moodle path/to/plugin/

Frequently Asked Questions about moodle-standards

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce Moodle PHP coding standards on my plugin code?

Moodle coding standards enforce PSR-12 with Moodle exceptions on PHP code. Run phpcs with the Moodle standard against your plugin directory to validate style, naming, PHPDoc headers, type hints, indentation, and array syntax automatically.

What PHP coding standards does Moodle require?

Moodle standards are PSR-12 with exceptions: 4-space indentation, no closing ?> tag, square bracket array syntax, line length limits, mandatory PHPDoc with @package/@param/@return, and specific naming rules for variables, functions, classes, and constants.

Can I automatically fix Moodle coding standard violations in my PHP files?

Yes, phpcs with the Moodle standard provides validation guidance and automated fixes for common violations like indentation, array syntax, and PHPDoc formatting in plugin directories.

Do I need to use PSR-12 for Moodle plugin development?

Moodle plugin development requires PSR-12 compliance with Moodle-specific exceptions. The Moodle standard built into phpcs enforces these rules for code review, formatting, and new file creation to maintain quality and collaboration.

How do I check if my Moodle plugin meets coding standards before submission?

Run phpcs with the Moodle standard on your plugin files to validate compliance with PSR-12, naming conventions, PHPDoc requirements, and type hints. The tool identifies violations and suggests fixes before code review or submission.