sandermuller/repo-new

CLI wizard for scaffolding repos using sandermuller/repo-init's playbook.

Maintainers

Package info

github.com/SanderMuller/repo-new

Homepage

pkg:composer/sandermuller/repo-new

Statistics

Installs: 12

Dependents: 0

Suggesters: 0

Stars: 1

1.0.0 2026-05-23 21:24 UTC

README

Latest Version on Packagist GitHub Tests Action Status Total Downloads License

Interactive CLI wizard that scaffolds a new PHP repo against the canonical Sander / hihaho baseline defined by sandermuller/repo-init. Same UX as laravel new — pick a category, answer a few questions, and get a repo with Composer dependencies installed, CI and quality tooling wired up, AI tooling synced, and composer test green on the first run.

Install (one-time per machine)

composer global require sandermuller/repo-new

Make sure your global Composer bin directory (~/.composer/vendor/bin or ~/.config/composer/vendor/bin) is on your PATH. sandermuller/repo-init — the source of the stubs and dependency lists — is pulled in automatically as a dependency; no separate install needed.

On first run, repo syncs its bundled AI skills to your user scope (~/.claude/skills/, ~/.codex/skills/, etc.) so they're available to every agent on the machine — no manual boost sync --scope=user step needed. Subsequent runs no-op via a per-version sentinel. Set BOOST_SKIP_AUTOSYNC=1 to disable.

Use

Interactive (recommended) — the wizard walks you through every choice:

repo new

Non-interactive (CI / scripting) — supply choices as flags:

repo new my-laravel-app \
  --type=laravel-project \
  --vendor=acme \
  --description="My new Laravel app" \
  --php=8.4 \
  --test-framework=phpunit

See repo new --help for the full flag list.

Categories

repo-new scaffolds seven repo categories. Choose one interactively, or pass --type:

Category (--type) What it scaffolds Runtime dependencies wired in Category options
laravel-project A full Laravel application via laravel new --boost, with the shared tooling baseline overlaid on top Laravel skeleton (laravel new) --with-hihaho-rules, --with-security-advisories
laravel-package A Laravel package — spatie/laravel-package-tools-based service provider, src/, tests/, publishable config illuminate/contracts, illuminate/support, spatie/laravel-package-tools --laravel=<constraint>
php-package A framework-agnostic PHP library none (pure library)
phpstan-extension A PHPStan rule / extension package phpstan/phpstan: ^2 --laravel-aware (swaps in larastan/larastan)
rector-extension A Rector rule / ruleset package rector/rector: ^2, symplify/rule-doc-generator-contracts --laravel-aware (adds driftingly/rector-laravel)
composer-plugin A Composer plugin — command provider and/or event subscriber skeleton composer-plugin-api: ^2.6 --plugin-shape=command-provider|event-subscriber|both|none
skill-bundle A boost-core skill bundle — pure-markdown AI skills under resources/boost/skills/, no PHP source or test runner sandermuller/boost-core

What it sets up

Beyond the category-specific source skeleton above, every scaffolded repo gets the same baseline:

  • Project filescomposer.json with PSR-4 autoloading, src/ + tests/, plus README.md, CHANGELOG.md, LICENSE, SECURITY.md, .editorconfig, .gitignore, .gitattributes (lean published archive), and .mcp.json.
  • CI workflows — GitHub Actions for the test suite, PHPStan, Pint, Rector, and changelog automation, plus a Dependabot config.
  • Quality tooling, configured and installed — Pint (pint.json), PHPStan (phpstan-baseline.neon) with the strict / deprecation / PHPUnit / disallowed-calls / Symplify extension set, Rector with type-perfect, and type-coverage + cognitive-complexity analysis. All wired into composer scripts.
  • Test suite — Pest or PHPUnit. PHPStan / Rector extensions and Laravel projects default to PHPUnit; other categories default to Pest (PHPUnit for the hihaho vendor). Override with --test-framework.
  • AI toolingsandermuller/package-boost-php + boost-core installed and a boost.php config scaffolded — the agents, dependency vendors, and sandermuller/boost-skills capability tags to sync (tags chosen interactively or via --skill-tags; package categories only — laravel-project uses laravel/boost instead). Then vendor/bin/boost sync generates .ai/, .claude/, .agents/, .cursor/, AGENTS.md, CLAUDE.md, and the per-agent skill directories.

Per-category runtime and dev dependencies come from repo-init's references/per-category-deps.yml, so the dependency set always matches the current canonical baseline.

skill-bundle is the lean exception: it ships pure-markdown skills with no PHP, so it skips the PHP toolchain (PHPStan, Rector, PHPUnit, .mcp.json, the phpstan / rector-check workflows) and the test runner — keeping Pint, lean-package-validator, the meta files, and the pint-check + update-changelog workflows.

How it works

  1. The wizard collects: category → vendor → package name → description → PHP version → (Laravel constraint for laravel-package, plugin shape for composer-plugin) → test framework → boost-skills tags → opt-ins.
  2. Runs laravel new --boost (for laravel-project) or copies the category stubs (for package categories) from the installed repo-init.
  3. Substitutes placeholders (__VENDOR__, __NAMESPACE__, __PACKAGE_STUDLY__, …) across composer.json, source files, and CI workflows.
  4. Pre-allows Composer plugins (phpstan/extension-installer, pestphp/pest-plugin) before requiring dependencies, so install never aborts on the plugin allowlist.
  5. Runs composer install and the per-category composer require lists.
  6. Fires vendor/bin/boost sync to generate the AI tooling files.
  7. Initializes a git repo (add --commit for an initial commit) and prints a copy-pasteable handoff prompt for Claude or your agent of choice.

Testing

composer test

Changelog

See CHANGELOG.md and releases.

Security

See SECURITY.md.

License

MIT — see LICENSE.