Skip to content
Skill

Moodle performance

Guides an agent through performance tuning for Moodle plugins: caching, queries, tasks

Moodle performance is an open-source agent skill for developer tools. It is available on Claude Code.

Scripts
None
Platforms
Claude Code
GitHub stars
44
Last commit
License
MIT
Listing updated

Similar skills

About Moodle performance

This skill gives an AI coding agent a performance playbook for Moodle plugin development. It covers defining and using Moodle Universal Cache (MUC) definitions with the right mode and key/data settings, cutting database load with recordsets, batched lookups and index design, and moving slow work into ad-hoc or scheduled tasks guarded by locks.

The skill also walks through diagnosis: enabling the performance debug footer and the $PERF counter, reading slow-query logs and running EXPLAIN on suspect queries, and using the profiling tool. It adds guidance on batching capability checks, lazy-loading AMD modules, OPcache and APCu settings, Redis sessions, and frontend build and caching flags, along with a table of common mistakes to avoid.

The agent works with PHP code in a Moodle codebase and uses its config.php, db/caches.php, db/tasks.php and XMLDB index definitions as the reference points. The skill itself is instructions only and runs no scripts.

When your agent uses it

Use when optimizing Moodle plugin performance — MUC caching definitions, query optimization, recordsets vs records, ad-hoc and scheduled tasks, lazy loading, OPcache, query log analysis, $PERF, and performance debug toolbar.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (9 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the moodle-dev plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add SaadRahman01/claude-moodle-dev
/plugin install moodle-dev@moodle-dev

Or copy only this skill to ~/.claude/skills/moodle-performance:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/moodle-performance &&
cp -R "$tmp/skills/moodle-performance" ~/.claude/skills/moodle-performance &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/moodle-performance inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/moodle-performance to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/moodle-performance &&
cp -R "$tmp/skills/moodle-performance" ~/.agents/skills/moodle-performance &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/moodle-performance inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/moodle-performance to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/moodle-performance &&
cp -R "$tmp/skills/moodle-performance" ~/.cursor/skills/moodle-performance &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/moodle-performance inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/SaadRahman01/claude-moodle-dev.git --path skills/moodle-performance

Or copy the folder to ~/.gemini/skills/moodle-performance yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/moodle-performance:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/moodle-performance &&
cp -R "$tmp/skills/moodle-performance" ~/.copilot/skills/moodle-performance &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/moodle-performance inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git

Then copy claude-moodle-dev/skills/moodle-performance into your agent's skills folder as moodle-performance. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

MUC cache definitions
Explains choosing application, session or request cache modes and setting simplekeys and simpledata for faster lookups.
Database query tuning
Covers recordsets over full loads, batching N+1 lookups with get_in_or_equal, and index and EXPLAIN checks.
Background task patterns
Shows how to queue ad-hoc tasks, define scheduled tasks and prevent overlapping runs with locks.
Capability check batching
Replaces per-row has_capability calls with a single get_users_by_capability query.
Profiling and debug tools
Describes the performance debug footer, the $PERF counter, slow-query logs and the profiling tool.
Server and frontend settings
Covers OPcache, APCu, Redis sessions, session lock release, AMD lazy loading and production theme settings.

Good for

  • Find out why a Moodle plugin page runs too many database queries
  • Convert a loop that loads a huge table into a streamed recordset
  • Move email sending out of a form POST handler into an ad-hoc task
  • Add a MUC cache definition with invalidation for a settings-driven value
  • Set up OPcache and session storage for a production Moodle server

Moodle performance FAQ

What does the skill need to run?

It is instructions only. It bundles no scripts, and its frontmatter sets no allowed tools. It assumes a Moodle plugin codebase in PHP.

When does Moodle performance trigger?

The description says it applies when optimizing Moodle plugin performance, covering MUC caching, query optimization, recordsets, tasks, lazy loading, OPcache, query log analysis, $PERF and the debug toolbar.

Which cache modes does Moodle performance describe?

It describes three MUC modes: application (persistent until invalidated), session (lasts for the session) and request (a single PHP request).

Does Moodle performance change the Moodle site automatically?

No. It gives code patterns and configuration examples for the agent to apply, such as config.php, php.ini and db/tasks.php settings.

How do I install Moodle performance in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/moodle-performance to use it in all your projects, or to .claude/skills/moodle-performance in one project. Or install the moodle-dev plugin, which includes it: /plugin marketplace add SaadRahman01/claude-moodle-dev, then /plugin install moodle-dev@moodle-dev.

Does Moodle performance run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Moodle performance?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

What are the best alternatives to Moodle performance?

The closest alternatives to Moodle performance are Moodle phpunit testing, Moodle plugin development, Moodle security audit, Moodle accessibility and Moodle upgrade migration.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from SaadRahman01/claude-moodle-dev

  1. Guides building and calling Moodle web services: external functions, tokens and schemas

    • Open source
    • 44 GitHub stars
    • Developer tools
  2. Guides agents to build Moodle plugin UI that meets WCAG 2.1 AA accessibility rules

    • Open source
    • 44 GitHub stars
    • Developer tools
  3. Guides writing Moodle browser JavaScript as AMD modules with grunt builds and tests

    • Open source
    • 44 GitHub stars
    • Developer tools
  4. Guides writing and running Behat acceptance tests for Moodle plugins

    • Open source
    • 44 GitHub stars
    • Developer tools
  5. Guides building and migrating Moodle 4.4+ hook classes, listeners and tests

    • Open source
    • 44 GitHub stars
    • Developer tools
  6. Guides building Moodle plugin UI that renders inside the Moodle Mobile app

    • Open source
    • 44 GitHub stars
    • Developer tools