Skip to content

Add AGENTS.md documentation for repository development workflow#424

Merged
Alanaktion merged 3 commits intomasterfrom
copilot/add-agents-documentation
Mar 4, 2026
Merged

Add AGENTS.md documentation for repository development workflow#424
Alanaktion merged 3 commits intomasterfrom
copilot/add-agents-documentation

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

Adds comprehensive developer documentation in AGENTS.md covering repository structure, tooling, and workflows for both AI agents and human developers.

Contents

  • Project structure - Directory layout and key file locations
  • Development setup - PHP 8.1+, Composer, database installation (MySQL/SQLite)
  • Code quality tools - PHPCS (PSR-12), Rector, syntax checking with configurations
  • Testing - PHPUnit setup and execution patterns
  • CI/CD - GitHub Actions matrix testing (PHP 8.1-8.4, MySQL/SQLite)
  • Docker - Build and multi-platform deployment
  • Plugin development - Standards and structure requirements
  • Troubleshooting - Common issues and solutions
  • Quick reference - Command snippets for frequent tasks

File is structured for rapid scanning with clear headings, code examples, and a command reference section at the end.

Original prompt

Write an AGENTS.md file describing how to work on this repository.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Alanaktion <236490+Alanaktion@users.noreply.github.com>
Copilot AI changed the title [WIP] Add AGENTS.md file for repository guidelines Add AGENTS.md documentation for repository development workflow Feb 2, 2026
Copilot AI requested a review from Alanaktion February 2, 2026 23:50
Updated repository structure and installation instructions. Removed troubleshooting section for clarity.
@Alanaktion Alanaktion marked this pull request as ready for review March 4, 2026 02:05
Copilot AI review requested due to automatic review settings March 4, 2026 02:05
@Alanaktion Alanaktion merged commit 4bf0314 into master Mar 4, 2026
3 of 19 checks passed
@Alanaktion Alanaktion deleted the copilot/add-agents-documentation branch March 4, 2026 02:05
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 AGENTS.md developer/agent guide intended to document repository structure, tooling, and common workflows for working on Phproject.

Changes:

  • Introduces AGENTS.md with setup instructions, repository layout, and development workflow guidance.
  • Documents code-quality tooling (PHPCS, Rector), testing (PHPUnit), CI matrix, Docker workflows, and plugin conventions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

### Security

Report security vulnerabilities via:
- [GitHub](https://github.com/Alanaktion/phproject/security/advisories/new)
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

The “Security” reporting instructions conflict with SECURITY.md: the repo asks reporters to use huntr.dev or email, not GitHub Security Advisories. Please align this section with the documented policy to avoid sending reports to the wrong place.

Suggested change
- [GitHub](https://github.com/Alanaktion/phproject/security/advisories/new)
- [huntr.dev](https://huntr.dev/repos/Alanaktion/phproject/)

Copilot uses AI. Check for mistakes.
2. Implement `_load()` method for initialization
3. Implement `_installed()` method to check installation status
4. Optionally implement `_install()` method for installation
5. Include PHPDoc comment block with `@package` and `@author` tags
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

Plugin requirements are slightly overstated compared to app/plugin/README.md: that doc says the PHPDoc block must contain at least @package and should contain @author, not that @author is mandatory. Please adjust this list to match the source of truth so plugin authors don’t treat optional requirements as required.

Suggested change
5. Include PHPDoc comment block with `@package` and `@author` tags
5. Include a PHPDoc comment block with at least a `@package` tag (an `@author` tag is recommended)

Copilot uses AI. Check for mistakes.
vendor/bin/phpunit --no-progress # Run tests without progress output

# Install application
php install.php [options] # Interactive or CLI install
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

The quick reference says php install.php [options] is “Interactive or CLI install”, but install.php is interactive in the browser and non-interactive on CLI (it prints help when args are missing). Consider rewording this line to distinguish browser-based install vs. CLI install requiring the --site-* and --admin-* args.

Suggested change
php install.php [options] # Interactive or CLI install
php install.php --site-* --admin-* [options] # Non-interactive CLI install; requires --site-* and --admin-* arguments
# For interactive install, open the application in a browser and follow the web installer

Copilot uses AI. Check for mistakes.
# Code quality checks
vendor/bin/phpcs # Check code style
vendor/bin/rector process --dry-run # Check for refactoring suggestions
find . -name "*.php" ! -path "./vendor/*" -exec php -l {} \; # Syntax check
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

This quick-reference syntax check differs from the earlier “Syntax Check” section and from CI: it omits 2>&1 and any filtering/exit-on-error behavior, so it will print “No syntax errors detected” for every file and still exit 0 even when errors occur in the middle of a pipeline. Please make the quick reference consistent with the recommended/CI command.

Suggested change
find . -name "*.php" ! -path "./vendor/*" -exec php -l {} \; # Syntax check
if find . -name "*.php" ! -path "./vendor/*" -exec php -l {} \; 2>&1 | grep -v "No syntax errors detected"; then exit 1; fi # Syntax check

Copilot uses AI. Check for mistakes.

1. **Clone the repository:**
```bash
cd /home/runner/work/phproject/phproject
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

The “Clone the repository” step is incorrect/incomplete: it only cds into a GitHub Actions runner path and never performs a git clone. This path won’t exist for most developers, so the setup instructions will fail as written. Update this step to show the actual clone command (and then cd into the repo) using a generic path.

Suggested change
cd /home/runner/work/phproject/phproject
git clone <repository-url>
cd phproject

Copilot uses AI. Check for mistakes.
Basic PHP syntax validation:

```bash
find . -name "*.php" ! -path "./vendor/*" -exec php -l {} 2>&1 \; | grep "syntax error"
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

The suggested syntax-check pipeline will exit with a non-zero status when there are no syntax errors (because grep returns 1 on no matches), which makes it awkward to use in scripts/CI. CI uses an if ... | grep "syntax error, unexpected"; then exit 1; fi pattern to fail only when errors exist—consider mirroring that here (and in the quick reference) for correct exit behavior.

Suggested change
find . -name "*.php" ! -path "./vendor/*" -exec php -l {} 2>&1 \; | grep "syntax error"
if find . -name "*.php" ! -path "./vendor/*" -exec php -l {} 2>&1 \; | grep "syntax error, unexpected"; then
exit 1
fi

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.

3 participants