PHPackages                             stellarwp/foundation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. stellarwp/foundation

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

stellarwp/foundation
====================

Foundation is a StellarWP monorepo

1.3.0(3w ago)11.2k↑111.1%1[2 issues](https://github.com/stellarwp/foundation/issues)[1 PRs](https://github.com/stellarwp/foundation/pulls)GPL-2.0-or-laterPHPPHP &gt;=8.3CI passing

Since Jun 2Pushed 3w agoCompare

[ Source](https://github.com/stellarwp/foundation)[ Packagist](https://packagist.org/packages/stellarwp/foundation)[ RSS](/packages/stellarwp-foundation/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (32)Versions (8)Used By (0)

Foundation
==========

[](#foundation)

Foundation is a StellarWP Composer monorepo for reusable PHP packages intended for libraries and WordPress plugin ecosystems.

Note

This monorepo splits each package out into their own sub-repository, if you only need a specific component you can install only that specific one.

Repositories
------------

[](#repositories)

- [stellarwp/foundation-container](https://github.com/stellarwp/foundation-container)
- [stellarwp/foundation-container-wordpress](https://github.com/stellarwp/foundation-container-wordpress)
- [stellarwp/foundation-pipeline](https://github.com/stellarwp/foundation-pipeline)
- [stellarwp/foundation-log](https://github.com/stellarwp/foundation-log)
- [stellarwp/foundation-wpcli](https://github.com/stellarwp/foundation-wpcli)
- [stellarwp/foundation-cli](https://github.com/stellarwp/foundation-cli)

Installation
------------

[](#installation)

Install the aggregate package when you want the convenient all-in-one Foundation package:

```
composer require stellarwp/foundation
```

The aggregate package includes all Foundation components, including the CLI package and `vendor/bin/foundation`. For lean production WordPress plugin archives, require only the split packages your plugin needs and install `stellarwp/foundation-cli` as a development dependency.

‍💻 Developer / Contributing Documentation
-----------------------------------------

[](#‍-developer--contributing-documentation)

### ✅ Development requirements

[](#-development-requirements)

- PHP 8.3+

### 🧪 Automated testing

[](#-automated-testing)

Run all tests:

```
composer test
```

Run just the unit test suite:

```
composer test:unit
```

Run just the feature test suite:

```
composer test:feature
```

Run the Codeception suites with SLIC:

```
slic run unit
slic run feature
composer test:wpunit
```

The first time you run the WordPress suite locally, point SLIC at the directory that contains this repository and select the `foundation` project:

```
cd ..
slic here
cd foundation
slic use foundation
slic composer install
slic cc build
composer test:wpunit
```

If dependencies were installed on a different host PHP version and the SLIC container reports Composer platform conflicts, refresh them inside SLIC:

```
slic composer update --with-all-dependencies
```

Run `slic cc build` again after changing Codeception suite configuration or modules. Generated Codeception actor files are written to `tests/CodeceptionSupport/` and are intentionally ignored.

The `unit` and `feature` SLIC suites run the same tests as `composer test:unit` and `composer test:feature`. The `wpunit` suite runs WordPress-loaded tests through wp-browser.

Generate the test coverage HTML dashboard (XDEBUG required to be enabled on your machine):

```
composer test:coverage-html
```

### Code Quality

[](#code-quality)

Check your code style:

```
composer lint
```

Automatically fix your code style:

```
composer format
```

Static analysis:

```
composer analyze
```

### 🥳 Releasing a new version

[](#-releasing-a-new-version)

Before drafting the release, run only the monorepo maintenance commands that prepare the release line itself:

SituationCommandWhyYou are planning a major version release, for example `2.0` to `3.0`. You should run this so any Foundation packages that depend on each other require the new major line, such as `^3.0`. You may also run it for a minor release if one package must require APIs added in that new minor version.`composer monorepo bump-interdependency `, then `composer monorepo merge`Updates package-to-package dependency constraints for the release being published. Use the release's minimum Composer constraint, such as `^3.0` or `^1.2`.Internal package constraints already match the release line.No pre-release monorepo maintenance command is needed.Continue to drafting the release.After any needed command, commit the updated `composer.json` files. Then draft a new release on [GitHub](https://github.com/stellarwp/foundation/releases/new), following [semver](https://semver.org/) closely.

The [monorepo split GitHub workflow](./.github/workflows/monorepo-split.yml) deploys each project's code to its sub-repository on pushes to `main` and when release tags are pushed. Publishing a GitHub release creates the release tag and triggers the tagged split.

After a successful tagged split for a minor or major `.0` release, the workflow automatically moves `dev-main` to the next development line. For example, publishing `1.2.0` causes the workflow to bump internal constraints to `^1.3` and branch aliases to `1.3.x-dev`. Patch releases such as `1.2.1` intentionally skip this step.

If the automated post-release bump fails, fetch the release tag and manually run `composer monorepo bump-interdependency `, `composer monorepo package-alias`, and `composer monorepo merge`, then commit and push the updated package `composer.json` files.

Adding a new split package is usually a minor [semver](https://semver.org/) release because it adds new functionality without breaking existing packages. Use a major release only if the change also breaks an existing public API or package contract.

### Monorepo

[](#monorepo)

This uses [Symplify's Monorepo Builder](https://github.com/symplify/monorepo-builder). There is a shortcut composer script you can run to access their CLI: `composer monorepo list` to see the available commands.

#### Adding a New Package

[](#adding-a-new-package)

1. Run the package creation command:

```
composer run foundation -- package:create
```

The package argument can be a new package component such as `WPCli`, an existing package directory, short package name, or Composer package name, for example `Log`, `foundation-log`, or `stellarwp/foundation-log`.

If the package does not exist yet, the command asks whether to create the local scaffold in `src/` and asks for the Composer package name with a default such as `stellarwp/foundation-wpcli`. The scaffold includes the required `composer.json`, `README.md`, `.gitattributes`, `.gitignore`, and `close-pull-request.yml` files. After scaffolding, the command runs `composer monorepo merge` so the root `composer.json` includes the new package.

The command runs as a dry run by default. It validates the required split package files, prints the target repository name and description, and shows the GitHub CLI commands it will run.

2. Add source code, tests, and any package-specific dependencies to the new package.
3. Once you've added the specific dependencies your package needs to its composer.json, run `composer monorepo merge` again and then `composer update` and commit the changes. This will merge the dependency changes into the root composer.json.
4. Create and configure the read-only split repository:

```
composer run foundation -- package:create  --apply
```

The command creates the `stellarwp/foundation-` repository with the standard `[READ ONLY]` description and disables issues, wiki, projects, and pull requests. The package's `close-pull-request.yml` workflow is still included as a fallback guard for read-only split repositories.

#### Generating WP-CLI Commands

[](#generating-wp-cli-commands)

In a consuming WordPress project, install the generator as a development dependency:

```
composer require --dev stellarwp/foundation-cli
```

If the generated command will ship with the plugin, install the runtime WP-CLI package as a normal dependency:

```
composer require stellarwp/foundation-wpcli
```

Then generate a starter WP-CLI command:

```
vendor/bin/foundation make:wpcli-command Sync_Products_Command
```

The command reads the project's PSR-4 Composer autoload namespaces, writes a Snake\_Case command class under `Cli/Commands` inside the selected PSR-4 root, and uses the default WP-CLI command stub from `foundation-wpcli`.

If your project adds a Composer script such as `"foundation": "@php vendor/bin/foundation"`, you may run the command as `composer run foundation -- make:wpcli-command Sync_Products_Command`.

`stellarwp/foundation-cli` is build-time developer tooling when installed as a split package. Do not register `StellarWP\Foundation\Cli\CliProvider` in a WordPress plugin application, and do not include the CLI split package in production plugin zips. Production split-package installs should normally run with Composer's `--no-dev` mode so the generator, Symfony Console, and other dev tooling are not packaged.

To customize the generated command stub in a project, create:

```
foundation/stubs/wpcli/command.stub

```

Project-level stubs are local scaffolding assets. Add them to the consuming project's production zip exclusions, such as `.gitattributes`, when they should not be included in release archives.

License
-------

[](#license)

Copyright © 2026 Nexcess Corp.

Licensed under the GNU General Public License v2.0 or later. See [LICENSE](./LICENSE) for details.

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance75

Regular maintenance activity

Popularity23

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 61% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~9 days

Total

4

Last Release

22d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e3171496e198834c638911ad3c3220bec77871cdf6557eaa9e2a58d16600a1a1?d=identicon)[bordoni](/maintainers/bordoni)

![](https://www.gravatar.com/avatar/97fd764aa710e8d8263a7e3b3fececdfd736b8aad8055227bf592ddf50ad15ba?d=identicon)[stellarwp](/maintainers/stellarwp)

![](https://www.gravatar.com/avatar/1a11f5bee6606989680c8f81b921f8a8e2e75bfd5190cb001812ed615d032a5e?d=identicon)[tribejustin](/maintainers/tribejustin)

---

Top Contributors

[![defunctl](https://avatars.githubusercontent.com/u/1066195?v=4)](https://github.com/defunctl "defunctl (50 commits)")[![dpanta94](https://avatars.githubusercontent.com/u/29694484?v=4)](https://github.com/dpanta94 "dpanta94 (31 commits)")[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/stellarwp-foundation/health.svg)

```
[![Health](https://phpackages.com/badges/stellarwp-foundation/health.svg)](https://phpackages.com/packages/stellarwp-foundation)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.5k](/packages/laravel-framework)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k16](/packages/tempest-framework)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[lion/bundle

Lion-framework configuration and initialization package

122.4k4](/packages/lion-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M600](/packages/shopware-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
