php artisan boost:add-skill voku/portable-ascii
Save this content to: AGENTS.md
---
package: voku/portable-ascii
source_path: AGENTS.md
repo: https://github.com/voku/portable-ascii
---
# AGENTS.md
## Setup
- Install project dependencies with `composer install` from the repository root.
- Install documentation generator dependencies with `composer install` from `build/`.
## Validation
- Run the test suite with `php vendor/bin/phpunit -c phpunit.xml`.
- PHPStan is installed in CI on demand and is not part of the committed root `require-dev` set.
- Before running static analysis locally, install PHPStan the same way CI does: `composer require --dev --no-interaction phpstan/phpstan:^2.1 phpstan/phpstan-strict-rules:^2.0`.
- Then run static analysis with `php vendor/bin/phpstan analyse -c phpstan.neon`.
- Also run the PHP 7-targeted static analysis with `php vendor/bin/phpstan analyse -c phpstan-php7.neon`.
- After changing PHP code, run PHPUnit and both PHPStan commands before wrapping up.
## Performance Comparison
- Use `PORTABLE_ASCII_RUN_PERFORMANCE_TESTS=1 ./vendor/bin/phpunit --filter PerformanceRegressionTest` to collect the benchmark profile for the current worktree.
- When comparing the current `ASCII.php` against `master`, back up the current file first, e.g. `cp src/voku/helper/ASCII.php /tmp/portable-ascii-ASCII.php.backup`.
- Then run the benchmark twice:
1. once with the current `ASCII.php`
2. once after temporarily restoring only `src/voku/helper/ASCII.php` from `master`
- Restore the file from the backup copy after the `master` run instead of restoring from `HEAD`.
- Do it this way because `ASCII.php` may contain important unstaged local edits. A temporary `git restore --source master --worktree -- src/voku/helper/ASCII.php` is fine for the comparison run, but restoring from `HEAD` afterwards can silently discard local uncommitted performance fixes. Restoring from the backup gives a byte-for-byte return to the original local file.
- Use the `portable-ascii performance profile` block from PHPUnit for the actual comparison.
- Do not assume `master` will pass the current benchmark thresholds. The comparison may still be valid even if the `master` run fails an assertion, as long as the benchmark profile was printed.
## Documentation
- `README.md` is generated. Do not edit the generated API section by hand.
- Regenerate it from the repository root with `php build/generate_docs.php`.
- The generator reads `build/docs/base.md` and `src/voku/helper/ASCII.php`.
## Notes
- Keep changes focused and minimal.
- When updating public ASCII APIs, regenerate `README.md` if the API documentation changes.
composer install from the repository root.composer install from build/.php vendor/bin/phpunit -c phpunit.xml.require-dev set.composer require --dev --no-interaction phpstan/phpstan:^2.1 phpstan/phpstan-strict-rules:^2.0.php vendor/bin/phpstan analyse -c phpstan.neon.php vendor/bin/phpstan analyse -c phpstan-php7.neon.PORTABLE_ASCII_RUN_PERFORMANCE_TESTS=1 ./vendor/bin/phpunit --filter PerformanceRegressionTest to collect the benchmark profile for the current worktree.ASCII.php against master, back up the current file first, e.g. cp src/voku/helper/ASCII.php /tmp/portable-ascii-ASCII.php.backup.ASCII.phpsrc/voku/helper/ASCII.php from mastermaster run instead of restoring from HEAD.ASCII.php may contain important unstaged local edits. A temporary git restore --source master --worktree -- src/voku/helper/ASCII.php is fine for the comparison run, but restoring from HEAD afterwards can silently discard local uncommitted performance fixes. Restoring from the backup gives a byte-for-byte return to the original local file.portable-ascii performance profile block from PHPUnit for the actual comparison.master will pass the current benchmark thresholds. The comparison may still be valid even if the master run fails an assertion, as long as the benchmark profile was printed.README.md is generated. Do not edit the generated API section by hand.php build/generate_docs.php.build/docs/base.md and src/voku/helper/ASCII.php.README.md if the API documentation changes.How can I help you explore Laravel packages today?