-
Notifications
You must be signed in to change notification settings - Fork 2
Add GitHub Copilot instructions for repository #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,136 @@ | ||||
| # GitHub Copilot Instructions for MageForge | ||||
|
|
||||
| ## Project Overview | ||||
|
|
||||
| MageForge is a powerful CLI front-end development toolkit for Magento 2 that simplifies theme development workflows. It provides tools for many types of Magento themes (Magento Standard, Hyvä, Hyvä Fallback, Custom TailwindCSS, Avanta B2B) and can be easily extended for custom themes. | ||||
|
|
||||
| ## Technology Stack | ||||
|
|
||||
| - **Platform**: Magento 2 (requires 2.4.7 or higher) | ||||
| - **Language**: PHP 8.3+ | ||||
| - **Package Manager**: Composer | ||||
| - **Type**: magento2-module | ||||
| - **Dependencies**: | ||||
| - Laravel Prompts (for interactive CLI) | ||||
| - Magento Framework | ||||
|
|
||||
| ## Coding Standards | ||||
|
|
||||
| ### General PHP Standards | ||||
|
|
||||
| - **Follow Magento Coding Standards**: All PHP code must adhere to the Magento 2 Coding Standards | ||||
| - **PSR-4 Autoloading**: The project uses PSR-4 with namespace `OpenForgeProject\MageForge\` | ||||
| - **Type Declarations**: Use strict typing (`declare(strict_types=1);`) at the top of every PHP file | ||||
| - **Type Hints**: Always use type hints for parameters and return types | ||||
| - **Property Promotion**: Use PHP 8+ constructor property promotion with readonly where appropriate | ||||
| - **Documentation**: Use PHPDoc blocks for classes and methods | ||||
|
|
||||
| ### Code Formatting | ||||
|
|
||||
| - **Indentation**: Use 4 spaces (not tabs) for indentation | ||||
| - **Line Length**: Keep lines under 80 characters wherever possible | ||||
| - **Naming Conventions**: | ||||
| - Classes: PascalCase | ||||
| - Methods and properties: camelCase | ||||
| - Constants: UPPER_SNAKE_CASE | ||||
| - Choose meaningful names for variables and functions | ||||
| - **Comments**: Write clear and concise comments where necessary | ||||
|
|
||||
| ### Code Structure | ||||
|
|
||||
| - **Directory Structure**: | ||||
| - `src/Console/Command/` - CLI commands | ||||
| - `src/Service/` - Business logic services | ||||
| - `src/Model/` - Data models | ||||
| - `src/Exception/` - Custom exceptions | ||||
| - `src/Service/ThemeBuilder/` - Theme builder implementations | ||||
| - **Interfaces**: Use interfaces for builder patterns (e.g., `BuilderInterface`) | ||||
| - **Dependency Injection**: Use constructor injection with readonly properties | ||||
|
|
||||
| ## Build and Validation | ||||
|
|
||||
| ### Linting | ||||
|
|
||||
| - **PHPCS**: Use Magento Coding Standard for PHP code | ||||
| ```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/ | ||||
| ``` | ||||
|
||||
| ``` |
Note: The
-pflag shows progress, and the-sflag shows sniff codes in the output.
There was a problem hiding this comment.
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.