diff --git a/.changelog/consistent-skill-sources.md b/.changelog/consistent-skill-sources.md new file mode 100644 index 0000000..973c40e --- /dev/null +++ b/.changelog/consistent-skill-sources.md @@ -0,0 +1,11 @@ +--- +category: changed +type: patch +--- + +Synchronize the bundled local skill automatically and trust Fast Forward Composer +skill donors through `fast-forward/*`. +Resolve Changelog contributor skills from stable `0.4.x` releases without a +redundant skill allowlist. +Load the project autoloader for PHPDoc checks when DevTools is installed as a +dependency. diff --git a/.gitattributes b/.gitattributes index 6d27191..876d056 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10,3 +10,4 @@ /.changelog/ export-ignore /CONTRIBUTING.md export-ignore /skills.json export-ignore +/.php-cs-fixer.dist.php export-ignore diff --git a/.gitignore b/.gitignore index 3530d59..a07dcf2 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ vendor/ composer.lock *.cache /.agents/ +/.dev-tools/ diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..c43f679 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,38 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * + * @see https://github.com/php-fast-forward/clock + * @see https://github.com/php-fast-forward + * @see https://datatracker.ietf.org/doc/html/rfc2119 + */ + +use FastForward\DevTools\Path\WorkingProjectPathResolver; +use PhpCsFixer\Config; +use PhpCsFixer\Finder; + +require __DIR__ . '/vendor/autoload.php'; + +return (new Config()) + ->setRiskyAllowed(false) + ->setFinder(Finder::create()->in(__DIR__)->exclude(WorkingProjectPathResolver::TOOLING_EXCLUDED_DIRECTORIES)) + ->setRules([ + 'phpdoc_indent' => true, + 'phpdoc_order' => ['order' => ['param', 'return', 'throws']], + 'phpdoc_separation' => true, + 'phpdoc_trim' => true, + 'phpdoc_trim_consecutive_blank_line_separation' => true, + 'phpdoc_scalar' => true, + 'phpdoc_types' => true, + 'phpdoc_to_comment' => false, + 'phpdoc_add_missing_param_annotation' => true, + ]); diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2a6e011..227cef7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,9 +37,15 @@ still need editorial review; no PR attribution is inferred from prose alone. The development-only manager restores `fast-forward-container` and `fast-forward-config` from the installed Composer packages, including Config as -a transitive dependency. `skills.json` explicitly trusts only those two Composer -donors; dependency trust does not extend to other installed packages. No separate -GitHub source or version pin is used for either library. +a transitive dependency. `skills.json` trusts installed donors in the +`fast-forward/*` namespace; `trusted-replace` keeps other namespaces untrusted. +No separate GitHub source or version pin is used for either library. + +The bundled skill is also synchronized from the local `resources/skills` +directory, without a package override. Changelog instructions come from the +GitHub source at `^0.4.0`, discovered through its Composer metadata without a +skill allowlist. `auto-sync: true` restores these skills after normal Composer +install/update operations; `composer skills:update` refreshes them explicitly. Inspect donors with `composer skills:show` and refresh their payloads with `composer skills:update --from=composer`. The existing GitHub source continues diff --git a/composer.json b/composer.json index 59be4f3..cb7bb70 100644 --- a/composer.json +++ b/composer.json @@ -51,10 +51,11 @@ "ergebnis/composer-normalize": true, "fast-forward/dev-tools": true, "infection/extension-installer": true, + "llm/skills": true, "phpdocumentor/shim": true, "phpro/grumphp": true, - "pyrech/composer-changelogs": true, - "llm/skills": true + "phpro/grumphp-shim": true, + "pyrech/composer-changelogs": true }, "platform": { "php": "8.3.0" @@ -62,14 +63,14 @@ "sort-packages": true }, "extra": { - "skills": { - "source": "resources/skills" - }, "branch-alias": { "dev-main": "1.x-dev" }, "grumphp": { "config-default-path": "vendor/fast-forward/dev-tools/grumphp.yml" + }, + "skills": { + "source": "resources/skills" } }, "scripts": { diff --git a/examples/01-system-clock.php b/examples/01-system-clock.php index 0c0f380..5308eec 100644 --- a/examples/01-system-clock.php +++ b/examples/01-system-clock.php @@ -16,7 +16,7 @@ * @see https://datatracker.ietf.org/doc/html/rfc2119 */ -require dirname(__DIR__) . '/vendor/autoload.php'; +require __DIR__ . '/../vendor/autoload.php'; use FastForward\Clock\SystemClock; diff --git a/examples/02-system-clock-with-timezone.php b/examples/02-system-clock-with-timezone.php index fac07b4..46cc008 100644 --- a/examples/02-system-clock-with-timezone.php +++ b/examples/02-system-clock-with-timezone.php @@ -16,7 +16,7 @@ * @see https://datatracker.ietf.org/doc/html/rfc2119 */ -require dirname(__DIR__) . '/vendor/autoload.php'; +require __DIR__ . '/../vendor/autoload.php'; use FastForward\Clock\SystemClock; diff --git a/examples/03-frozen-clock.php b/examples/03-frozen-clock.php index ad50390..581ba1f 100644 --- a/examples/03-frozen-clock.php +++ b/examples/03-frozen-clock.php @@ -16,7 +16,7 @@ * @see https://datatracker.ietf.org/doc/html/rfc2119 */ -require dirname(__DIR__) . '/vendor/autoload.php'; +require __DIR__ . '/../vendor/autoload.php'; use FastForward\Clock\FrozenClock; diff --git a/examples/04-frozen-clock-inputs.php b/examples/04-frozen-clock-inputs.php index 5658f41..e230a3b 100644 --- a/examples/04-frozen-clock-inputs.php +++ b/examples/04-frozen-clock-inputs.php @@ -16,7 +16,7 @@ * @see https://datatracker.ietf.org/doc/html/rfc2119 */ -require dirname(__DIR__) . '/vendor/autoload.php'; +require __DIR__ . '/../vendor/autoload.php'; use FastForward\Clock\FrozenClock; diff --git a/examples/05-frozen-clock-container.php b/examples/05-frozen-clock-container.php index da4f2c7..db5dfea 100644 --- a/examples/05-frozen-clock-container.php +++ b/examples/05-frozen-clock-container.php @@ -16,7 +16,7 @@ * @see https://datatracker.ietf.org/doc/html/rfc2119 */ -require dirname(__DIR__) . '/vendor/autoload.php'; +require __DIR__ . '/../vendor/autoload.php'; use FastForward\Clock\ServiceProvider\ClockServiceProvider; use FastForward\Clock\FrozenClock; diff --git a/examples/06-psr20-clock-interface.php b/examples/06-psr20-clock-interface.php index 7eb163a..febf0cb 100644 --- a/examples/06-psr20-clock-interface.php +++ b/examples/06-psr20-clock-interface.php @@ -16,7 +16,7 @@ * @see https://datatracker.ietf.org/doc/html/rfc2119 */ -require dirname(__DIR__) . '/vendor/autoload.php'; +require __DIR__ . '/../vendor/autoload.php'; use FastForward\Clock\ServiceProvider\ClockServiceProvider; use Psr\Clock\ClockInterface; diff --git a/skills.json b/skills.json index 87f8ea0..47b322e 100644 --- a/skills.json +++ b/skills.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/roxblnfk/skills/master/resources/skills.schema.json", + "$schema": "https://raw.githubusercontent.com/roxblnfk/skills/1.15.0/resources/skills.schema.json", "target": ".agents/skills", "aliases": [], "discovery": false, @@ -8,20 +8,20 @@ "dependencies": { "composer": { "trusted": [ - "fast-forward/config", - "fast-forward/container" + "fast-forward/*" ], "trusted-replace": true } }, "sources": [ + { + "from": "dir", + "path": "resources/skills" + }, { "from": "github", "package": "php-fast-forward/changelog", - "ref": "^0.3.0", - "skills": [ - "fast-forward-changelog" - ] + "ref": "^0.4.0" } ] }