Maintenance in progress: we are indexing a large batch of new skills. Some pages may load slowly or briefly show no results. Nothing is lost, and everything is back to normal within the hour.

Moodle Coding Standards

Moodle coding standards with PSR-12 compliance and Frankenstyle naming. Use when developing Moodle plugins, writing PHP code for Moodle, or ensuring code quality compliance.

majiayu000 d5a481e 2 files · 2.0 KB Updated 567 repo stars

File contents

Moodle Coding Standards

Write compliant Moodle plugin code following PSR-12 and Moodle-specific conventions.

When to Use This Skill

  • Creating new Moodle plugins
  • Writing PHP code for Moodle
  • Code review and quality checks
  • Understanding Frankenstyle naming

See reference.md for complete standards.

Key Rules

Frankenstyle Naming

plugintype_pluginname
local_mymodule
mod_assignment
block_myblock

File Headers

<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software...

namespace local_mymodule;

defined('MOODLE_INTERNAL') || die();

Class Naming

// Class in local/mymodule/classes/helper.php
namespace local_mymodule;
class helper {
    // Methods use snake_case
    public function get_user_data() {
    }
}

Quick Checks

  • File header with license
  • defined('MOODLE_INTERNAL') || die();
  • Proper namespace
  • PSR-12 formatting
  • No direct DB queries (use DML)

majiayu000/claude-skill-registry-data/tree/main/data/moodle-standards commit d5a481e499

Frequently asked questions

npx skillmds add majiayu000/moodle-coding-standards