Guidance for coding agents working in this repository.
imbo/releaser is a PHP 8.3+ CLI application that helps create GitHub releases by:
- Inspecting branches, tags, and merged pull requests
- Determining the next semantic version from Conventional Commit titles
- Rendering release notes from Twig templates
- Creating tags/releases via GitHub APIs
- Language: PHP 8.3+
- CLI framework: Symfony Console
- HTTP: Guzzle
- Templating: Twig
- Conventional Commits parser:
ramsey/conventional-commits - Tests: PHPUnit
- Static analysis: PHPStan level 10
- Formatting/linting: PHP-CS-Fixer via
imbo/imbo-coding-standard
imbo-releaser: CLI entrypoint scriptsrc/Command/Release.php: Main release workflow commandsrc/Console/Application.php: Symfony Console app wiringsrc/Config.php,src/ConfigInterface.php,src/Config/Resolver.php: configuration defaults and config file loadingsrc/GitHub/*: API client and DTOstemplates/*.twig: release note templatestests/*: PHPUnit tests
Run from repository root:
composer run test— run PHPUnitcomposer run sa— run PHPStancomposer run cs— check coding stylecomposer run cs:fix— auto-fix coding stylecomposer run ci— check coding style + run static analysis and tests
Run composer run ci after making changes.
- Keep
declare(strict_types=1);in PHP files. - Match existing namespace/layout conventions (
ImboReleaser\..., PSR-4 undersrc/). - Prefer typed signatures and explicit return types.
- Keep docblocks for non-obvious behavior and useful type information (especially array shapes/generics for PHPStan).
- Follow existing error handling style: throw
RuntimeException/InvalidArgumentExceptionwith actionable messages. - Keep changes surgical; avoid broad refactors unless explicitly requested.
- Add/update PHPUnit tests when modifying behavior in
src/. - Prefer focused tests next to related existing test suites (
tests/Config,tests/GitHub, etc.). - Use
#[CoversClass(...)]like existing tests. - Do not introduce network-dependent tests; use Guzzle mock handlers/patterns already used in
tests/GitHub/ClientTest.php.
- Repository format is
owner/repo. - Branch conventions are centered around
mainand maintenance branches (X.x/vX.x) per README assumptions. - Tag conventions are semantic versions (
X.Y.Z, optionalvprefix). - Release notes are generated from merged PRs (Conventional Commit-compatible titles).
- Configuration is loaded from
.imbo-releaser.phpor.imbo-releaser.dist.php(or explicit--config).
- Do not edit
vendor/or generated coverage output underbuild/. - Avoid committing local environment files (
.env,.imbo-releaser.php, local tool cache files). - Keep CLI UX and options backward-compatible unless the task explicitly requires breaking changes.
- If you see unrelated local changes in the working tree, do not revert them.
- Update source in
src/with minimal surface-area changes. - Add/adjust tests in
tests/. - Run relevant checks (
composer test,composer sa,composer cs). - Update
README.mdwhen user-facing behavior or configuration changes.