Quickly scaffold a PHP package that follows the Atomic style (as used by atomic-php/http-kernel and atomic-php/router).
- Structure:
src/,tests/,benchmarks/,.github/workflows/ci.yml - QA:
.editorconfig,.php-cs-fixer.php,psalm.xml,phpunit.xml.dist - Docs:
README.md,LICENSE(MIT),CONTRIBUTING.md,SECURITY.md,CHANGELOG.md - Composer scripts:
test,test-coverage,psalm,cs-check,cs-fix,benchmark,qa - Optional PSR requirements: PSR-7, PSR-15, PSR-11
- bash
- git + GitHub CLI (
gh auth login) - PHP 8.4+, Composer (for the generated package)
# Basic
scripts/scaffold-php-package.sh http-foundation "PSR-7 utilities and factories" --with-psr7
# With PSR-15 and Container
scripts/scaffold-php-package.sh events "Lightweight event dispatcher" --with-psr15 --with-container
# Customize vendor, org, keywords
scripts/scaffold-php-package.sh cache "Simple cache library" \
--vendor atomic --org atomic-php --keywords "php cache performance library"Options:
--org(default:atomic-php): GitHub organization used in README badges--vendor(default:atomic): Composer vendor name--name-slug: override the Composer package name (defaults to directory name)--keywords: space‑separated keywords for composer.json--with-psr7: addpsr/http-message--with-psr15: addpsr/http-server-handlerandpsr/http-server-middleware--with-container: addpsr/container
- Composer metadata aligned with Atomic repos
- CI workflow mirroring the Atomic style (tests, coverage, psalm, cs, validate)
- Standard code quality and docs files
cd <dir>
composer install
git init && git add . && git commit -m "chore: initial scaffold"
# Create GitHub repo and push
gh repo create atomic-php/<dir> --public --source=. --remote=origin --pushMIT