This guide is specific to packages/core.
packages/core is the shared logic layer for Flexi packages.
- Keep business/workflow logic here.
- Keep CLI UI and command surface outside core.
- No command framework classes in core.
- Do not add Symfony Console command/input/output classes.
- Do not add Laravel Artisan command classes.
- Core APIs should accept plain PHP values (arrays/strings/bools/DTOs), not CLI framework objects.
- User interaction orchestration (command options, signatures, command registration) belongs to package-specific CLI layers.
src/Core/: constants, schema/config/file generation internalssrc/Service/: reusable workflow/domain servicessrc/Installer/: package manager installers and adapterssrc/Utils/: utility functions (http/file)src/Libs/: orchestration helpers used by CLI layersstubs/: scaffold templates
From packages/core:
composer installSyntax check:
find src -name '*.php' -print0 | xargs -0 -n1 php -l- Prefer small, focused commits.
- Keep backward compatibility for consumers (
packages/cli,packages/laravel) unless a coordinated refactor is done. - If you change a core method signature, update both CLI packages in the same change set.
- Add concise inline comments only where logic is non-obvious.
There is no full automated suite yet. For core changes:
- Run syntax checks in core.
- Smoke test impacted commands via consumers:
- Symfony CLI (
packages/cli) - Laravel Artisan (
packages/laravel)
- Symfony CLI (
- Validate generated files when touching stubs/generation logic.
- Change stays within core scope
- No command-framework objects leaked into core APIs
- Syntax checks pass
- Consumer packages remain functional
- Docs updated when behavior changes