Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 5, 2025

Configures GitHub Copilot coding agent with repository-specific context per best practices.

Changes

  • Added .github/copilot-instructions.md with:
    • Magento 2 module context (PHP 8.3+, requires 2.4.7+)
    • Coding standards: Magento Coding Standards, PSR-4, strict typing with declare(strict_types=1), constructor property promotion with readonly
    • Code formatting: 4-space indentation, 80-char lines, PascalCase classes, camelCase methods
    • Build validation: PHPCS with Magento2 standard
    • Git conventions: #<issue> - <message> commit format
    • Project structure: Command patterns, service layer, theme builder interface implementations
    • Domain guidance: Theme builders in Service/ThemeBuilder/, Magento DI patterns, CLI command shortcodes

This enables Copilot to generate code consistent with project conventions and understand the Magento 2 module architecture.

Original prompt

This section details on the original issue you should resolve

<issue_title>✨ Set up Copilot instructions</issue_title>
<issue_description>Configure instructions for this repository as documented in Best practices for Copilot coding agent in your repository.

</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: dermatz <6103201+dermatz@users.noreply.github.com>
Copilot AI changed the title [WIP] Configure Copilot instructions for the repository Add GitHub Copilot instructions for repository Dec 5, 2025
Copilot AI requested a review from dermatz December 5, 2025 12:45
@dermatz dermatz marked this pull request as ready for review December 12, 2025 13:13
Copilot AI review requested due to automatic review settings December 12, 2025 13:13
@dermatz dermatz enabled auto-merge (squash) December 12, 2025 13:13
@dermatz dermatz disabled auto-merge December 12, 2025 13:13
@dermatz dermatz merged commit 0579171 into main Dec 12, 2025
15 checks passed
@dermatz dermatz deleted the copilot/set-up-copilot-instructions branch December 12, 2025 13:13
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

This PR adds GitHub Copilot instructions to configure the coding agent with repository-specific context for the MageForge project, following GitHub's best practices for Copilot integration.

Key Changes

  • Added comprehensive .github/copilot-instructions.md file with Magento 2 module context
  • Documented coding standards including PHP 8.3+ requirements, PSR-4, strict typing, and constructor property promotion
  • Included project-specific conventions for Git workflow, CLI command patterns, and theme builder architecture

Comment on lines +56 to +57
composer create-project magento/magento-coding-standard --stability=dev /tmp/magento-coding-standard
/tmp/magento-coding-standard/vendor/bin/phpcs -p -s --standard=Magento2 src/
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

The command example shows installing magento-coding-standard to /tmp/ which is a temporary directory that may be cleared on system restart. Consider documenting a more permanent installation location or using a project-local installation method via composer require-dev for better reproducibility.

Suggested change
composer create-project magento/magento-coding-standard --stability=dev /tmp/magento-coding-standard
/tmp/magento-coding-standard/vendor/bin/phpcs -p -s --standard=Magento2 src/
composer require --dev magento/magento-coding-standard
vendor/bin/phpcs -p -s --standard=Magento2 src/

Copilot uses AI. Check for mistakes.
```bash
composer create-project magento/magento-coding-standard --stability=dev /tmp/magento-coding-standard
/tmp/magento-coding-standard/vendor/bin/phpcs -p -s --standard=Magento2 src/
```
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

The formatting example shows -p -s flags for phpcs but doesn't explain what these flags do. Consider adding a brief explanation (e.g., "-p shows progress, -s shows sniff codes") to make the documentation more helpful for contributors who may not be familiar with PHPCS.

Suggested change
```

Note: The -p flag shows progress, and the -s flag shows sniff codes in the output.

Copilot uses AI. Check for mistakes.
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.

✨ Set up Copilot instructions

2 participants