{"kind":"AgentDefinition","metadata":{"namespace":"community","name":"moodle","version":"0.1.0"},"spec":{"agents_md":"---\napplyTo: '**/*.php, **/*.js, **/*.mustache, **/*.xml, **/*.css, **/*.scss'\ndescription: 'Instructions for GitHub Copilot to generate code in a Moodle project context.'\n---\n\n# Project Context\n\nThis repository contains a Moodle project. Ensure that any generated code is compatible with the specific Moodle version used in this project (for example, Moodle 3.11, 4.1 LTS, or later).\n\nIt includes:\n- Plugin development (local, block, mod, auth, enrol, tool, etc.)\n- Theme customization\n- CLI scripts\n- Integrations with external services using the Moodle API\n\n# Code Standards\n\n- Follow the official Moodle Coding guidelines: https://moodledev.io/general/development/policies/codingstyle\n- PHP must be compatible with the core version (e.g., PHP 7.4 / 8.0 / 8.1).\n- Do not use modern syntax that is not supported by core if it breaks compatibility.\n- Class naming must use Moodle namespaces.\n- Follow Moodle’s standard plugin directory layout (for example: classes/output, classes/form, db/, lang/, templates/…).\n- Mandatory use of Moodle security functions:\n  - `$DB` with SQL placeholders\n  - `require_login()`, `require_capability()`\n  - Parameters handled with `required_param()` / `optional_param()`\n\n# Code Generation Rules\n\n- When creating new PHP classes in plugins, use the Moodle component (Frankenstyle) namespace that matches the plugin's component name, e.g. `local_myplugin`, `mod_forum`, `block_mycatalog`, `tool_mytool`.\n- In plugins, always respect the structure:\n  - /db\n  - /lang\n  - /classes\n  - /templates\n  - /version.php\n  - /settings.php\n  - /lib.php (only if necessary)\n\n- Use renderers and Mustache templates for HTML. Do not mix HTML inside PHP.\n- In JavaScript code, use AMD modules, not inline scripts.\n- Prefer Moodle API functions over manual code whenever possible.\n- Do not invent Moodle functions that do not exist.\n\n# Examples of What Copilot Should Be Able to Answer\n\n- \"Generate a basic local plugin with version.php, settings.php, and lib.php.\"\n- \"Create a new table in db/install.xml and an upgrade script in db/upgrade.php.\"\n- \"Generate a Moodle form using moodleform.\"\n- \"Create a renderer with Mustache to display a table.\"\n\n# Expected Style\n\n- Clear and specific answers in the Moodle context.\n- Always include files with full paths.\n- If there are multiple ways to do something, use the approach recommended by Moodle.\n\n","description":"Instructions for GitHub Copilot to generate code in a Moodle project context.","import":{"commit_sha":"541b7819d8c3545c6df122491af4fa1eae415779","imported_at":"2026-05-18T20:05:35Z","license_text":"MIT License\n\nCopyright GitHub, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","owner":"github","repo":"github/awesome-copilot","source_url":"https://github.com/github/awesome-copilot/blob/541b7819d8c3545c6df122491af4fa1eae415779/instructions/moodle.instructions.md"},"manifest":{}},"content_hash":[209,196,207,239,205,199,209,1,204,15,249,148,45,222,85,26,93,15,153,40,18,157,227,121,66,94,118,110,48,171,37,29],"trust_level":"unsigned","yanked":false}
