Skip to content

Add Moodle instructions#743

Open
bhect0 wants to merge 2 commits intogithub:mainfrom
bhect0:main
Open

Add Moodle instructions#743
bhect0 wants to merge 2 commits intogithub:mainfrom
bhect0:main

Conversation

@bhect0
Copy link

@bhect0 bhect0 commented Feb 17, 2026

Pull Request Checklist

  • I have read and followed the CONTRIBUTING.md guidelines.
  • My contribution adds a new instruction, prompt, agent, or skill file in the correct directory.
  • The file follows the required naming convention.
  • The content is clearly structured and follows the example format.
  • I have tested my instructions, prompt, agent, or skill with GitHub Copilot.
  • I have run npm start and verified that README.md is up to date.

Description

This pull request adds Moodle development instructions for GitHub Copilot. The instructions are completely understandable for everyone, no matter if it's familiar with Moodle ecosystem or not.


Type of Contribution

  • New instruction file.
  • New prompt file.
  • New agent file.
  • New plugin.
  • New skill file.
  • Update to existing instruction, prompt, agent, plugin, or skill.
  • Other (please specify):

Additional Notes


By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.

Copilot AI review requested due to automatic review settings February 17, 2026 07:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new GitHub Copilot custom instruction file intended to guide code generation for Moodle project development, and registers it in the instructions catalog.

Changes:

  • Added instructions/moodle.instructions.md with Moodle-oriented project context and coding/generation guidance.
  • Updated docs/README.instructions.md to include the new Moodle instructions entry.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
instructions/moodle.instructions.md Introduces Moodle-specific Copilot guidance (frontmatter + standards/rules/examples).
docs/README.instructions.md Adds the Moodle instructions link to the instructions index table.

- PHP must be compatible with the core version (e.g., PHP 7.4 / 8.0 / 8.1).
- Do not use modern syntax that is not supported by core if it breaks compatibility.
- Class naming must use Moodle namespaces.
- Use the MVC structure in plugins (classes/output, classes/form, db/, lang/, templates/…).
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Referring to Moodle plugins as using an "MVC structure" is misleading—Moodle doesn’t follow a formal MVC architecture. Consider describing the expected plugin directory/layout and common class locations (e.g., classes/output, classes/form, db, lang, templates) without labeling it MVC.

Suggested change
- Use the MVC structure in plugins (classes/output, classes/form, db/, lang/, templates/…).
- Follow Moodle’s standard plugin directory layout (for example: classes/output, classes/form, db/, lang/, templates/…).

Copilot uses AI. Check for mistakes.
# Examples of What Copilot Should Be Able to Answer

- "Generate a basic local plugin with version.php, settings.php, and lib.php."
- "Create a new table in install.xml and an upgrade script in upgrade.php."
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Moodle plugins, install.xml and upgrade.php live under the db/ directory (i.e., db/install.xml and db/upgrade.php). Updating the example to include the correct paths will prevent Copilot from generating incorrectly located files.

Suggested change
- "Create a new table in install.xml and an upgrade script in upgrade.php."
- "Create a new table in db/install.xml and an upgrade script in db/upgrade.php."

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@@ -0,0 +1,57 @@
---
applyTo: '*.php, *.js, *.mustache, *.xml, *.css, *.scss'
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The applyTo glob only matches files in the repository root (e.g., *.php) and will miss typical Moodle code under subdirectories. Please switch to recursive patterns (e.g., **/*.php, **/*.js, ...) to match the convention described in instructions/instructions.instructions.md (multiple patterns examples).

Suggested change
applyTo: '*.php, *.js, *.mustache, *.xml, *.css, *.scss'
applyTo: '**/*.php, **/*.js, **/*.mustache, **/*.xml, **/*.css, **/*.scss'

Copilot uses AI. Check for mistakes.

# Project Context

This repository contains a Moodle project. It is based on Moodle version XXXX (specify version).
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file includes an unresolved placeholder (Moodle version XXXX (specify version)), which makes the instructions feel incomplete and may confuse users. Consider rephrasing to either remove the placeholder or explicitly instruct the user to replace it with their Moodle version (and optionally link to where to find it).

Suggested change
This repository contains a Moodle project. It is based on Moodle version XXXX (specify version).
This 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).

Copilot uses AI. Check for mistakes.

# Code Generation Rules

- When creating new classes, use the namespace `vendor\pluginname`.
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moodle plugin classes typically use the component (Frankenstyle) namespace (e.g., local_pluginname, mod_forum) rather than a generic vendor\\pluginname. Updating this guidance will help Copilot generate code that matches Moodle’s autoloading and naming conventions.

Suggested change
- When creating new classes, use the namespace `vendor\pluginname`.
- 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`.

Copilot uses AI. Check for mistakes.
Copy link
Author

@bhect0 bhect0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with all the tips. I submitted a commit that addresses all of the points :)

# Examples of What Copilot Should Be Able to Answer

- "Generate a basic local plugin with version.php, settings.php, and lib.php."
- "Create a new table in install.xml and an upgrade script in upgrade.php."
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@@ -143,6 +143,7 @@ Team and project-specific instructions to enhance GitHub Copilot's behavior for
| [Power Platform MCP Custom Connector Development](../instructions/power-platform-mcp-development.instructions.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fpower-platform-mcp-development.instructions.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fpower-platform-mcp-development.instructions.md) | Instructions for developing Power Platform custom connectors with Model Context Protocol (MCP) integration for Microsoft Copilot Studio |
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with all the tips. I submitted a commit that addresses all of the points :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant