This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
PHP CLI tool (Laravel Zero) that updates CHANGELOG files following the "Keep a Changelog" format. Published as wnx/changelog-updater and also used via stefanzweifel/changelog-updater-action GitHub Action.
Requires PHP 8.4+.
- Run tests:
composer test(runs Pest) - Run single test:
vendor/bin/pest --filter="test name" - Run single test file:
vendor/bin/pest tests/Feature/UpdateCommandTest.php - Lint/format:
vendor/bin/pint - Static analysis:
vendor/bin/phpstan analyse - Build PHAR:
composer build
Built on Laravel Zero with a single command (UpdateCommand) as the entry point.
- Actions (
app/Actions/) — Service objects containing business logic. The main orchestrator isAddReleaseNotesToChangelogAction, which detects changelog structure and delegates to eitherPlaceReleaseNotesAtTheTopAction(no Unreleased section) orPlaceReleaseNotesBelowUnreleasedHeadingAction(Keep a Changelog format with Unreleased heading). - Queries (
app/Queries/) — Encapsulated document traversal using League\CommonMark'sNode\Querywith customQueryExpressions. - Support (
app/Support/) —Markdownfacade wraps League\CommonMark parsing andwnx/commonmark-markdown-rendererfor AST-to-Markdown rendering.GitHubActionsOutputhandles writing to$GITHUB_OUTPUT.
- Parse changelog to CommonMark AST via
MarkdownParser - Traverse/modify AST using Query objects with custom
QueryExpressions(HeadingLevel,HeadingText) - Render modified AST back to Markdown via
MarkdownRenderer
- Pint: Laravel preset with
declare_strict_typesenforced - PHPStan: Level 6 with Larastan extension
- CI: Tests run on PHP 8.4 and 8.5 with 90% coverage minimum
Tests use Pest. Feature tests in tests/Feature/ test the full command pipeline. Unit tests in tests/Unit/ test individual actions/queries. Test fixtures (changelog stubs) live in tests/Stubs/.
The base TestCase mocks GitHubActionsOutput and provides assertGitHubOutputContains()/assertGitHubOutputDoesntContain() helpers.