Skip to content
Skill

Moodle amd JavaScript

Guides writing Moodle browser JavaScript as AMD modules with grunt builds and tests

Moodle amd JavaScript is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

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

Similar skills

About Moodle amd JavaScript

This skill covers front-end JavaScript for Moodle plugins. It explains the AMD layout that separates ES6 source in amd/src from the generated minified files in amd/build, how module IDs map to plugin component paths, and how PHP code loads a module with js_call_amd. It also walks through a sample module that binds click handlers, calls a web service and re-renders a Mustache fragment.

The guidance includes the grunt commands for building, linting and watching AMD code, along with a table of common Moodle core helpers such as core/ajax, core/str, core/templates, core/modal, core/notification and core/pending. It also points out pitfalls like editing build output by hand, using the deprecated modal factory on Moodle 4.3 and later, and leaving async work unmarked so Behat tests flake.

Users need a Moodle codebase with Node and npm available so the grunt tasks can run, and web services must be declared in db/services.php to be callable from the browser. Testing options listed are manual checks, Behat browser tests and Jest on Moodle 4.4 and later.

When your agent uses it

Use when writing JavaScript for Moodle — AMD modules, ES6 source, grunt build, RequireJS loading, core/ajax + core/str + core/templates + core/modal + core/notification, Mustache template hydration, and AMD unit tests.

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 (8 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-amd-javascript:

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-amd-javascript &&
cp -R "$tmp/skills/moodle-amd-javascript" ~/.claude/skills/moodle-amd-javascript &&
rm -rf "$tmp"

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

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/moodle-amd-javascript 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-amd-javascript &&
cp -R "$tmp/skills/moodle-amd-javascript" ~/.agents/skills/moodle-amd-javascript &&
rm -rf "$tmp"

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

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/moodle-amd-javascript 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-amd-javascript &&
cp -R "$tmp/skills/moodle-amd-javascript" ~/.cursor/skills/moodle-amd-javascript &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/moodle-amd-javascript 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-amd-javascript

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

Gemini CLI docs on skills

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

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-amd-javascript &&
cp -R "$tmp/skills/moodle-amd-javascript" ~/.copilot/skills/moodle-amd-javascript &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/moodle-amd-javascript 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-amd-javascript into your agent's skills folder as moodle-amd-javascript. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

AMD module structure
Explains the amd/src and amd/build layout and how module IDs are derived from file paths.
Core helper modules
Reference table of Moodle core modules for AJAX, strings, templates, modals and notifications.
Mustache and JS pairing
Shows how a PHP-rendered template is hydrated and wired to a module's init function.
Grunt build workflow
Commands for building, linting and watching AMD code from the Moodle root.
Behat-safe async handling
Describes marking pending work so browser tests wait for asynchronous requests.
AMD unit testing options
Summarises manual, Behat and Jest approaches to testing Moodle AMD modules.

Good for

  • Add an interactive button to a Moodle plugin that updates a row without reloading
  • Call a plugin web service from browser JavaScript and display the results
  • Render a Mustache template on the client after an AJAX response
  • Show a confirmation modal before deleting a record in a Moodle plugin
  • Set up grunt to build and lint a plugin's AMD modules

Moodle amd JavaScript FAQ

What does Moodle amd JavaScript need to be used?

It assumes a Moodle codebase with Node and npm, where grunt can run from the Moodle root using the repository's .nvmrc.

Should generated build files be edited?

No. The skill says to edit amd/src files and rebuild with grunt, and to commit both source and build output.

Which modal module should be used on newer Moodle versions?

From Moodle 4.3 the skill recommends core/modal, which replaces the deprecated core/modal_factory.

How are web service methods made callable from JavaScript?

They must be declared with 'ajax' => true in db/services.php, and the session token is attached automatically.

How do I install Moodle amd JavaScript in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/moodle-amd-javascript to use it in all your projects, or to .claude/skills/moodle-amd-javascript 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 amd JavaScript 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 amd JavaScript?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Moodle amd JavaScript?

The closest alternatives to Moodle amd JavaScript are Moodle behat testing, Moodle accessibility, Moodle plugin development, Moodle theme development and Moodle phpunit testing.

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 and running Behat acceptance tests for Moodle plugins

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

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

    • Open source
    • 44 GitHub stars
    • Developer tools
  6. Guides an agent through performance tuning for Moodle plugins: caching, queries, tasks

    • Open source
    • 44 GitHub stars
    • Developer tools