Architecture and Command Lifecycle
The package has two connected execution models: local command execution and consumer repository synchronization.
Local Command Lifecycle
bin/dev-toolsloadsbin/dev-tools.php.bin/dev-tools.phpprefers the consumervendor/autoload.phpand falls back to the package autoloader.FastForward\DevTools\Console\DevTools::create()builds a shared container fromFastForward\DevTools\ServiceProvider\DevToolsServiceProvider.FastForward\DevTools\Console\CommandLoader\DevToolsCommandLoaderlazily discovers#[AsCommand]classes and resolves them from that container.standardsis used as the default command when no explicit command name is given.FastForward\DevTools\Composer\Capability\DevToolsCommandProvideronly adapts the same application command set for Composer plugin integration.
Consumer Synchronization Lifecycle
- A library installs
fast-forward/dev-toolsas a development dependency. - Composer loads
FastForward\DevTools\Composer\Plugin. - The plugin exposes commands through
FastForward\DevTools\Composer\Capability\DevToolsCommandProvider. - After
composer installorcomposer update, the plugin runsvendor/bin/dev-tools dev-tools:sync. FastForward\DevTools\Console\Command\SyncCommandupdatescomposer.jsonscripts, funding metadata, workflow stubs,.editorconfig,dependabot.yml,.gitignore,.gitattributes, the project license, and packaged Git hooks.- In normal mode,
dev-tools:syncalso runswiki --init,skills, andagentsto initialize the wiki submodule and synchronize packaged links into.agents/skillsand.agents/agents. - In
--dry-run,--check, and--interactivemodes,wiki,skills, andagentsare skipped because they do not yet expose non-destructive verification paths. FastForward\DevTools\Sync\PackagedDirectorySynchronizercreates missing links, repairs broken ones, and preserves consumer-owned directories for both synchronization flows.
Documentation Pipeline
FastForward\DevTools\Console\Command\DocsCommandreads PSR-4 paths fromcomposer.jsonviaComposerJsonInterface.- It generates a temporary
phpdocumentor.xmlfile in the configured cache directory. - phpDocumentor builds API pages from those PSR-4 paths.
- phpDocumentor also builds the guide from the selected
docs/source directory. FastForward\DevTools\Console\Command\ReportsCommandcombines that documentation build with PHPUnit coverage generation.
Dependency Injection
DevToolsServiceProvider
builds the shared application container used by
DevTools::create()
. Most commands receive collaborators through
constructor injection once resolved by that container, while command discovery
itself stays lazy through DevToolsCommandLoader
.
The provider wires the command runtime by concern rather than by one flat command list:
| Concern | Services |
|---|---|
FastForward\DevTools\Process\ProcessBuilderInterface
|
ProcessBuilderInterface
and ProcessQueueInterface
build and
execute subprocess pipelines. |
Filesystem and metadata
|
FilesystemInterface
, ComposerJsonInterface
, and
FileLocatorInterface
resolve local files, project metadata, and
packaged resources. |
Console bootstrapping
|
CommandLoaderInterface
resolves lazy command loading, and
Composer\Plugin\Capability\CommandProvider
exposes the same
command set to Composer. |
Changelog and Git
|
The changelog manager, parser, renderer, checker, and
GitClientInterface
support changelog authoring, verification, and
release-note flows. |
Synchronization helpers
|
Git ignore, Git attributes, license, resource diffing, and coverage summary services support consumer sync and reporting workflows. |
Shared infrastructure
|
LoggerInterface
, ClockInterface
, and Twig's
LoaderInterface
provide reusable runtime infrastructure. |