- Core code lives in
src/under theKoriym\XdebugMcpnamespace; CLI entrypoints are inbin/(xstep,xtrace,xprofile,xcoverage,xback,check-env). - Tests are in
tests/(Unit/,Integration/,docker/,ai/), with fixtures undertests/fixturesand fake data undertests/fake. - Documentation and assets reside in
docs/; sample scenarios are underdemo/; profiler helpers live inprofiler/. - Quality configs:
phpcs.xml,phpstan.neon,psalm.xml,rector.php,phpunit.xml.
- Install deps:
composer install. - Fast test run:
composer test(PHPUnit). - Full gate:
composer tests(coding standard, static analysis, then PHPUnit). - Coverage:
composer coverage(usesbin/xcoverage+ PHPUnit, writes tobuild/coverage). - Static analysis:
composer sa(PHPStan) andcomposer psalm. - Coding standard:
composer cs/ autofix withcomposer cs-fix. - Environment helpers:
composer check-env,composer install-mcp,composer install-desktop.
- Do not include local shell aliases, machine-specific PHP selector names, absolute private setup paths, or private environment setup details in public-facing docs, commits, PR bodies, issue comments, release notes, or examples.
- When reporting validation publicly, translate local setup commands to portable project commands such as
composer test,composer demo,composer cs,composer validate --strict, orphp -d memory_limit=512M ./vendor/bin/phpstan.
- Follow PSR-12 with Doctrine Coding Standard tweaks (
phpcs.xml); 4-space indent, trailing commas where allowed, single quotes unless interpolation needed. - Namespace paths mirror
src/layout; classes/interfaces usePascalCase, methods/propertiescamelCase; tests end with*Test.php. - Prefer typed properties/parameters/returns; keep public surface minimal and log through PSR-3.
- Run
composer csandcomposer sabefore pushing; commit fixes in separate change sets when practical.
- Framework: PHPUnit (
phpunit.xml). Place new unit specs intests/Unit, integration intests/Integration; name files{Subject}Test.php. - Use data providers for matrix cases; prefer deterministic fixtures in
tests/fixtures. - For coverage-sensitive work, run
composer coverage; for end-to-end CLI checks,composer test-json. - Include failing test reproduction when fixing bugs; keep Docker-related scenarios under
tests/docker.
- Commit messages are short and prefixed by scope (e.g.,
docs: ...,refactor: ...,fix: ...); group unrelated changes into separate commits. - PRs should describe intent, approach, and risk; link issues when available and paste relevant CLI output (test/coverage snapshots,
check-envfor environment changes). - Add screenshots or logs when touching docs/UX or CLI output formatting; note any required Xdebug/runtime configuration adjustments.
- Xdebug must be installed but normally disabled; use
bin/check-envto verify and to set up MCP/Claude integration (.mcp.jsonor.claude/skillssymlink). - Avoid committing secrets in example configs; prefer environment variables and keep sample credentials in
demo/only.