bagisto/bagisto-package-generator
An Artisan-based generator for Bagisto that scaffolds a complete package skeleton, including service providers, config, routes, views, and boilerplate, so developers can start building custom e-commerce extensions faster without manual setup.
What this is from a TPM's chair: a dev-time Artisan command that emits a Bagisto-shaped package skeleton — composer manifest, service provider, config, routes, migrations, views, translations, and the standard directory anatomy. It is not a runtime dependency, not a package manager, not a marketplace client, and not a platform service. Treat the decision as a developer-experience and standardisation asset with a governance question stapled to it, not an architectural component. If it surfaces in a design review framed as "how we manage extensions," correct the record immediately.
Architecture fit: It fits only a deliberate "extend Bagisto through packages, do not fork core" strategy. That is a roadmap-level bet which must already be made — adopting the generator is merely its operational expression. Where the roadmap contains vertical-specific builds (B2B pricing, custom checkout, ERP/3PL connectors) or a partner/integrator channel, this is a cheap enabler for consistent module anatomy across authors. It contributes nothing to headless storefront work, cross-service concerns, or non-Bagisto Laravel projects. Scope it explicitly to Bagisto extension development in the decision record, or it will be cited as an answer to problems it does not solve.
Integration feasibility: High, and cheap to disprove. require-dev in the host Bagisto app, run the make command, diff the emitted tree against your strongest existing internal package. Budget one developer-day for the spike plus a written gap analysis. No procurement cycle, no security architecture review beyond standard supply-chain hygiene on a dev dependency, no code migration. The absence of a migration burden is precisely why this can be decided in a sprint retro rather than a steering committee.
Technical risk: Low-to-moderate, concentrated almost entirely in version drift rather than code quality. The v2.1.2 notes are the useful evidence: a payment-method file convention fix, a missing info key that caused an error, and syntax updates. That is a generator which has shipped wrong output on specific paths. Treat every scaffold as a draft requiring review, not a correct-by-construction artifact. Secondary risks: 44 stars and 0 dependents implies a single-maintainer project with no ecosystem pressure to track the next core major; and empty test stubs can be misread by the uninvolved as coverage.
Risk register for the ADR:
| Risk | Likelihood | Impact | Owner | Mitigation |
|---|---|---|---|---|
| Generated output silently diverges from core | Medium | Medium | Eng lead | Version-pin; regenerate and diff on every Bagisto upgrade |
| Upstream abandonment | Medium | Low | TPM | Fork the stubs internally — they are templates, not logic |
| Teams bypass the tool, conventions split | Medium | Medium | Eng manager | Documented default in handbook and onboarding; never a CI gate |
| Package sprawl inflates upgrade surface | Medium | High | Architect | Lightweight "new package vs. extend existing" review gate |
| Stub tests read as real coverage | Medium | Medium | QA lead | Require at least one meaningful test before a package is called done |
| Scope creep into "runtime package management" | Low | High | TPM | Explicit non-goal in the decision record |
Key questions to settle before committing:
Stack fit: Native Laravel/Bagisto, so there is no new technology to introduce. It belongs in require-dev alongside PHPUnit, Pint, and Larastan. Pin three axes in the ADR — PHP version, Laravel major, and Bagisto core — because all three bound the generator's assumptions and any one of them can invalidate the output. No container changes, no infrastructure, no new deployment artifact, no environment parity concerns. That is the whole reason this is a one-day decision rather than a quarter-long one.
Migration path: Greenfield-only. It creates packages; it does not retrofit them. Separate the two things stakeholders will conflate:
Compatibility: Treat the generator as version-locked to Bagisto core in practice, whatever the composer constraint says. When core moves, regenerate a throwaway package and diff the tree before trusting it for real work. Make that a line item in the upgrade runbook rather than tribal knowledge held by whoever adopted it.
Sequencing:
require-dev on a scratch branch. Scaffold one package. Diff against the best existing internal package. Produce a written gap analysis covering anatomy, tests, and naming conventions.Maintenance: Near-zero runtime surface, non-zero knowledge surface. The tool itself needs a version pin and an owner. The real maintenance obligation is the upgrade-time regeneration-and-diff ritual — budget roughly half a day per Bagisto core upgrade and put it in the runbook. Because the asset is stubs rather than logic, forking on abandonment costs days per year, not a project. That asymmetry is what makes the maintenance risk acceptable.
Support: Community-grade, likely single-maintainer, no SLA. Never make it a dependency of record, never promise it to a customer, and never let it appear in a customer-facing capability list. Internal support burden concentrates in two places: onboarding (walk new hires through what was generated and why, so it accelerates understanding rather than replacing it) and dispute resolution when two teams disagree on convention. The second needs an owning architect, not a TPM escalation path.
Scaling: Scales linearly with extension throughput — more packages means more compounding savings and more sprawl risk in equal measure. The two scaling limits to watch: package count (each is a surface a core upgrade can break, so the gate matters more as volume rises) and contributor diversity (external partners benefit most and cost least to align, which is exactly where standardisation ROI is strongest). Do not scale it into adjacent uses — theme/CSS customisation doesn't need a full scaffold, and runtime package management is a different product.
Failure modes and responses:
| Failure mode | Signal | Response |
|---|---|---|
| Generator diverges from core after upgrade | Regenerated throwaway package diffs non-trivially | Block adoption for that core version; patch stubs in a fork |
| Sprawl — packages create for everything | Package count rises faster than shipped features | Escalate to gate owner; require justification in review |
| Silent convention split | Two distinct module anatomies in the codebase | Handbook default + onboarding checklist; do not escalate to a CI gate |
| Stub tests treated as coverage | Extension PRs merge with generated empty tests | QA gate: one meaningful test before "done" |
| Upstream goes stale or silent | No commits/releases against a core version we need | Execute the fork — days, not a project |
| Scope creep to runtime management | Roadmap item references this as package installer | Kill in review against the recorded non-goal |
Ramp-up: Very fast for anyone already doing Laravel work — the command is self-documenting after one demonstration. Budget about half a day per developer to get productive and a short written walkthrough in onboarding. The ramp cost is not learning the tool; it is learning which parts of the generated output to trust, which is why the reviewed-draft posture must be taught explicitly and not left to be discovered. Partner ramp is the highest-value case: they produce conforming packages without reverse-engineering conventions or filing structural support tickets.
Success measurement: Baseline before the pilot and re-measure at 60–90 days — time-to-first-PR on new extensions (upward efficiency) and structural review comments per extension PR (downward trend). Watch package count per quarter as a guardrail, not a KPI. Frame all of it as "we absorb more custom work per sprint without adding headcount," never as headcount reduction — and do not fund it as a feature.
How can I help you explore Laravel packages today?