Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-devWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/saadrahman01/claude-moodle-dev/moodle-upgrade-migration)<a href="https://agentmods.dev/rules/saadrahman01/claude-moodle-dev/moodle-upgrade-migration"><img src="https://agentmods.dev/badge/rules/saadrahman01/claude-moodle-dev/moodle-upgrade-migration.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.03347 |
| Opus 5 | $0.00000 | $0.01673 |
| Sonnet 5 | $0.00000 | $0.00669 |
| Haiku 4.5 | $0.00000 | $0.00335 |
Grade A, and why
moodle-upgrade-migration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 323 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Moodle Upgrade & Migration
Overview
Moodle deprecates aggressively but rarely removes. Code from Moodle 2.x often still runs in 4.5 — but uses APIs that emit warnings, fail PHP 8 strict checks, or block plugin directory acceptance. This skill catalogs the migration path from each generation.
When to Use
- Upgrading a plugin to support a newer Moodle version
- Resolving deprecation warnings
- Migrating to PHP 8.1 / 8.2 / 8.3 / 8.4
- Plugin directory submission rejection ("uses deprecated API")
- Cross-version compat (
$plugin->requiresbump)
Strategy
- Bump
$plugin->requiresto your minimum target Moodle version - Replace deprecated APIs (table below)
- Add
upgrade.txtto document changes - Run
phpcs --standard=moodle+ visual smoke test - Bump
$plugin->version+ adddb/upgrade.phpstep if schema changed
Deprecation table
| Old | New | Since |
|---|---|---|
print_error('errkey', 'comp') |
throw new \moodle_exception('errkey', 'comp') |
3.7 |
add_to_log() |
Trigger an event class | 2.7 |
notify('text', 'notifyproblem') |
\core\notification::error('text') |
3.0 |
redirect($url, 'msg', 0) |
redirect($url, 'msg', null, \core\notification::INFO) |
3.0 |
external_api (bare) |
\core_external\external_api |
4.2 |
external_function_parameters etc. |
\core_external\... |
4.2 |
$mform->setHelpButton() |
$mform->addHelpButton() |
2.0 |
Magic callbacks <comp>_extend_navigation |
Hooks API \core\hook\... (where applicable) |
4.4 |
\core\session\manager::write_close() |
Same — but check if needed | — |
mtrace() in non-CLI |
Use debugging() or proper logger |
— |
cleardoubleslashes |
Use clean_param($url, PARAM_URL) |
— |
addslashes() for DB |
Use $DB->... placeholders |
2.0 |
mysql_* functions |
$DB always |
2.0 |
userdate($t, '', false) (no timezone) |
Pass timezone or use core_date::get_user_timezone_object() |
3.2 |
create_function() |
Closures function() { } |
PHP 7.2 removed |
each($array) |
foreach |
PHP 7.2 removed |
assert($string) |
Real expression | PHP 7.2+ |
(unset) cast |
Plain unset() |
PHP 7.2+ |
\Mustache_Engine direct |
$OUTPUT->render_from_template |
— |
cm_info::get_modinfo second arg |
API change in 3.4 | 3.4 |
format_text no context |
Always pass ['context' => $context] |
2.0 |
\html_writer::nonempty_tag |
Use html_writer::tag with check |
3.5 |
\stdClass w/o : \stdClass return type in PHP 8.1+ |
Add return types | 8.1 |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 323 lines · 0 tokens per session scan A 74ce05425be8
moodle-upgrade-migration is a cursor rule published in the GitHub repository SaadRahman01/claude-moodle-dev (36 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,347 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
add-landing-template
Workflow for adding a new org landing-page template (editorial, vibrant, terminal, etc.) to the ClassroomIO monorepo. Activate when the user asks to add/create/build a new landing template or theme, or hands over a design reference for a new landing visual style.
typescript-exhaustive-switch
Use exhaustive switch handling for TypeScript unions and enums.
ecoconception-php
Règles d'écoconception pour le code PHP, ORM sobre, générateurs, OPcache, connexions réutilisées.
php-basics-patterns
PHP Basics series patterns and conventions extracted from the completed series.
laravel-package-coding-standards
A set of coding rules for Laravel packages, with conventions for names and code across several development areas.
no-inline-imports
Keep imports at top of file and avoid inline imports.