Cursor rule
.cursor/rules/moodle-plugin-structure.mdc[object Object]
Cursor rules
Quality
54/100
Scores the file, not the repository.Length
244 words
5 headings · 3 code blocksRepository
4
— · pushed 2 days agoLast changed
3 days ago
First indexed 3 days ago.123456# Moodle Plugin Structure78## Purpose9Ensure proper organization and structure for Moodle plugins following Moodle's plugin architecture.1011## Instructions12When creating or modifying Moodle plugins, follow these structural guidelines:13141. **Plugin Types**: Follow Moodle's plugin type conventions (mod, block, local, auth, etc.)152. **Directory Structure**: Use standard Moodle plugin directory layout163. **Version File**: Always include `version.php` with proper version information174. **Language Files**: Include language strings in `lang/en/` directory185. **Capabilities**: Define capabilities in `db/access.php` or `db/capabilities.php`196. **Database Schema**: Use `db/install.xml` for database tables207. **Settings**: Use `settings.php` for admin settings218. **Lib Functions**: Place helper functions in `lib.php`229. **Classes**: Use `classes/` directory for PHP classes2310. **Templates**: Use `templates/` directory for renderable templates2425## Examples2627```php28<?php29// File: ./version.php3031defined('MOODLE_INTERNAL') || die();3233$plugin->component = 'local_myplugin';34$plugin->version = 2024120100;35$plugin->requires = 2022112800; // Moodle 4.136$plugin->maturity = MATURITY_STABLE;37$plugin->release = '1.0.0';38```3940```php41<?php42// File: ./db/access.php4344defined('MOODLE_INTERNAL') || die();4546$capabilities = [47 'local/myplugin:manage' => [48 'riskbitmask' => RISK_SPAM,49 'captype' => 'write',50 'contextlevel' => CONTEXT_SYSTEM,51 'archetypes' => [52 'manager' => CAP_ALLOW53 ]54 ]55];56```5758```php59<?php60// File: ./lib.php6162defined('MOODLE_INTERNAL') || die();6364/**65 * Get plugin data66 *67 * @param int $userid User ID68 * @return stdClass Plugin data69 */70function local_myplugin_get_data($userid) {71 global $DB;7273 return $DB->get_record('local_myplugin_data', ['userid' => $userid]);74}75```7677## Exceptions78- Custom plugins may have different requirements based on functionality79- Legacy plugins may not follow all conventions but should be updated when possible80
Also in WisdmLabs/moodle-local_edwiserreports-free
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-ajax-and-js-integration.mdc · 4 | Cursor rules | agent-behaviour | 50/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-configuration-management.mdc · 4 | Cursor rules | agent-behaviour | 36/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-database-patterns.mdc · 4 | Cursor rules | styledatabaseagent-behaviour | 54/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-error-handling.mdc · 4 | Cursor rules | agent-behaviour | 50/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-events-and-callbacks.mdc · 4 | Cursor rules | agent-behaviour | 50/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-file-and-media-handling.mdc · 4 | Cursor rules | agent-behaviour | 36/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-internationalization.mdc · 4 | Cursor rules | agent-behaviour | 36/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-performance-optimization.mdc · 4 | Cursor rules | performanceagent-behaviour | 50/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-php-coding-standards.mdc · 4 | Cursor rules | agent-behaviour | 50/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-scheduled-tasks.mdc · 4 | Cursor rules | agent-behaviour | 50/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-security-practices.mdc · 4 | Cursor rules | securityagent-behaviour | 50/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-testing-and-quality.mdc · 4 | Cursor rules | testtesting-strategyagent-behaviour | 54/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-web-services-and-api.mdc · 4 | Cursor rules | apiagent-behaviour | 50/100 | 3 days ago |
Diff against .cursor/rules/moodle-ajax-and-js-integration.mdc Diff against .cursor/rules/moodle-configuration-management.mdc Diff against .cursor/rules/moodle-database-patterns.mdc Diff against .cursor/rules/moodle-error-handling.mdc Diff against .cursor/rules/moodle-events-and-callbacks.mdc Diff against .cursor/rules/moodle-file-and-media-handling.mdc Diff against .cursor/rules/moodle-internationalization.mdc Diff against .cursor/rules/moodle-performance-optimization.mdc Diff against .cursor/rules/moodle-php-coding-standards.mdc Diff against .cursor/rules/moodle-scheduled-tasks.mdc Diff against .cursor/rules/moodle-security-practices.mdc Diff against .cursor/rules/moodle-testing-and-quality.mdc Diff against .cursor/rules/moodle-web-services-and-api.mdc
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
