sandermuller/repo-init 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sandermuller/repo-init

Composer 安装命令:

composer require sandermuller/repo-init

包简介

AI playbook + stub library for bootstrapping the canonical Sander/hihaho repo setup. Install globally: `composer global require sandermuller/repo-init`.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status Total Downloads License Laravel Boost

AI playbook + stub library for bootstrapping the canonical Sander / hihaho dev setup. Pure markdown + stub files. No PHP code in the package itself. Install globally once, use everywhere — same UX as composer global require laravel/installer.

What it does

Walks an AI agent (Claude Code, Cursor, GitHub Copilot, …) through bootstrap, audit, or upgrade of a PHP repo against a canonical baseline:

  • pint.json, phpstan.neon.dist, phpstan-baseline.neon, rector.php — code-quality tooling
  • .editorconfig, .gitattributes (with the # >>> package-boost (managed) >>> block — sentinel name preserved for backward compat; owned by package-boost-php), .gitignore
  • .mcp.json (Laravel-aware categories only; the framework-agnostic categories — php-package, composer-plugin, phpstan-extension, rector-extension, skill-bundle — skip it)
  • .config/boost.php — boost-core agent config, pinning Claude Code / Copilot / Codex (every category except laravel-project, which uses laravel/boost). The .config/ layout is canonical (boost-core ≥ 0.17); the sync manifest lives at .config/boost/
  • sandermuller/boost-skills — the shared dev-workflow skill library, added to require-dev + .config/boost.php; bootstrap interactively picks which skill tags (php / frontend / github / jira) to activate
  • Shared .github/workflows/{phpstan,pint-check,rector-check,update-changelog}.yml + per-category run-tests.yml + dependabot.yml
  • tests/Pest.php or phpunit.xml (vendor-driven default)
  • Per-category extras (testbench.yaml, workbench/, ServiceProvider, extension.neon, src/Plugin.{shape}.php for composer-plugin, etc.)

Install (one-time per machine)

composer global require sandermuller/repo-init
composer global exec -- boost sync --scope=user --all

The second command publishes the repo-init skill (and any other globally-installed sandermuller/boost-core consumer's skills) into ~/.claude/skills/sandermuller__repo-init/, ~/.cursor/skills/sandermuller__repo-init/, ~/.agents/skills/sandermuller__repo-init/, etc. The skill then auto-activates in any project. Re-run composer global exec -- boost sync --scope=user --all after each composer global update to refresh. (The composer global exec -- form runs boost from Composer's global vendor/bin/ regardless of your current directory; the literal -- separator stops Composer from interpreting boost's flags as its own.) See references/boost-core-user-scope.md for the full contract.

Changed in boost-core 0.6.0. Before 0.6.0 boost-core was a Composer plugin and auto-synced on every composer global install/update. 0.6.0 removed the plugin (boost-core is now type: library); the sync is the one-line manual command above instead. Older boost-core migrations (e.g. the 0.4.0 user-scope slug rename) are covered in UPGRADING.md.

Use

Ask Claude (or any agent with the synced skill):

Set up this repo as a Laravel package. Audit this repo against the canonical setup. Upgrade tooling here to current baseline.

The agent reads the repo-init skill, decides intent + category, and opens the matching phase file from $(composer global config home)/vendor/sandermuller/repo-init/phases/. Everything happens in your conversation; nothing is written to your target repo by repo-init itself (the agent does the writes, following the phase's instructions).

Update

composer global update sandermuller/repo-init
composer global exec -- boost sync --scope=user --all

The second line is required: boost-core 0.6.0 removed the auto-sync plugin, so refreshing the user-scope skill dirs is a manual command after every update.

Repo categories supported

Category Detection signal
laravel-project type: project + laravel/framework in require
laravel-package (sander-style) type: library + illuminate/* in require
laravel-package (spatie-style) + spatie/laravel-package-tools in require
php-package type: library, framework-agnostic
phpstan-extension type: phpstan-extension
rector-extension type: rector-extension
composer-plugin type: composer-plugin
skill-bundle type: library + sandermuller/boost-core in require

Each has its own bootstrap, audit, and upgrade phase file (23 phase files total — 7 audit + 7 upgrade + 9 bootstrap, the extra 2 bootstraps cover filament-plugin and nova-tool which fall through to laravel-package for audit/upgrade). composer-plugin covers framework-agnostic Composer plugins (e.g. boost-core, package-boost-php) with sub-flags for command-provider / event-subscriber shapes. skill-bundle covers distributable packages whose product is AI agent skills — type: library, sandermuller/boost-core in runtime require, ships resources/boost/skills/, no src/.

What's NOT in the package

  • No PHP source under src/. No artisan commands, no Symfony Console binary. The agent does all the work.
  • No state files written to your target repo. No .repo-init-state.json, no .ai/playbooks/repo-init/ copies. Stubs are read in place from the global vendor dir.
  • No automatic destructive ops. Every overwrite, every dep install, every composer require is gated on a prompt or a documented safety rail (see checklists/per-category-never-touch.md).

Project-local install (escape hatch)

If you want to pin a specific repo-init version per project:

composer require --dev sandermuller/repo-init
vendor/bin/boost sync

The project-local install takes precedence over the global one. Remove with composer remove --dev sandermuller/repo-init.

Uninstall

composer global remove sandermuller/repo-init

Optional skill cleanup (the synced user-level skill dirs survive composer global remove because sync writes file copies — see references/boost-core-user-scope.md):

rm -rf ~/.{claude,cursor,agents,github,amp,gemini,junie,kiro,opencode}/skills/sandermuller__repo-init

(boost-core 0.6+ fans into 9 agent targets — the brace expansion above clears all of them in one line. Keep the synced skills if you might re-install later — re-running the install + composer global exec -- boost sync --scope=user --all re-syncs them, so leaving them in place is harmless.)

Design

See SPEC.md for the full design (markdown-only + global-install model).

Highlights:

Dependencies

Runtime (require) — what composer global require sandermuller/repo-init pulls in for every consumer:

  • sandermuller/boost-coretype: library from 0.6.0 (the Composer plugin was removed in that release). Ships the standalone vendor/bin/boost bin and the BoostAutoSync::run auto-sync engine (silent on no-op installs; prints the one-line sync summary when wrote>0). Categories that depend on boost-core directly (skill-bundle) wire BoostAutoSync::run in post-install-cmd / post-update-cmd; wrapper categories instead wire their wrapper's namespace façade (PackageBoostPhp\Scripts\AutoSync::run / PackageBoostLaravel\Scripts\AutoSync::run), which delegates to it — so the scaffold references only a class from its own direct dependency. See references/composer-scripts.md.

Maintenance (require-dev) — used only by repo-init's own dev workflow; NOT propagated to consumers (Composer never installs a required package's require-dev):

  • sandermuller/package-boost-php — the boost-family umbrella repo-init dogfoods (it's also what the php-package / phpstan-extension / rector-extension / composer-plugin scaffolds pin).
  • sandermuller/boost-skills — the shared dev-workflow skill library (code-review, bug-fixing, pre-release, evaluate, …); boost-core syncs its skills into repo-init's agent dirs at dev time.
  • laravel/pint — code style.

Contributing

See CONTRIBUTING.md.

Security

See SECURITY.md.

Changelog

See CHANGELOG.md.

License

MIT — see LICENSE.

sandermuller/repo-init 适用场景与选型建议

sandermuller/repo-init 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 203 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 05 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「bootstrap」 「scaffold」 「laravel」 「ai」 「php-package」 「phpstan-extension」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 sandermuller/repo-init 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 sandermuller/repo-init 我们能提供哪些服务?
定制开发 / 二次开发

基于 sandermuller/repo-init 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 203
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 37
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-17