Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ without the file — defaults are sensible — but committing an explicit `skill
makes your skill setup reproducible across the team.

Auto-sync after every `composer install` / `update` is **on by default**, so after `init` you
get fresh skills with no further setup. To opt out, set `"auto-sync": false` in `skills.json`;
`composer install --no-scripts` also suppresses the auto-run for a single invocation without
changing the config.
get fresh skills with no further setup. To opt out, set `"auto-sync": false` in `skills.json`.
Note that `--no-scripts` does **not** skip it: that flag only disables the `scripts` section of
`composer.json`, while auto-sync is a plugin event listener. To skip it for a single invocation,
use `--no-plugins`, which disables every Composer plugin for that run.

### Global composer installation

Expand Down
12 changes: 5 additions & 7 deletions src/Composer/SkillsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@
* Wires our {@see CommandProvider} into Composer so that
* `composer skills:update` becomes available.
*
* By default the plugin follows a **pull model**: nothing touches the user's
* filesystem until they explicitly invoke `skills:update`. Projects that want
* a hands-off setup can opt in by setting `extra.skills.auto-sync: true` —
* the plugin then subscribes to {@see ScriptEvents::POST_INSTALL_CMD} and
* {@see ScriptEvents::POST_UPDATE_CMD} and runs sync automatically. The
* `composer --no-scripts` flag still suppresses the auto-run, because
* Composer skips dispatching script events entirely in that mode.
* Auto-sync listens to {@see ScriptEvents::POST_INSTALL_CMD} and
* {@see ScriptEvents::POST_UPDATE_CMD} and runs `skills:update` unless the
* project sets `auto-sync: false`. `composer --no-scripts` does not suppress
* it: in that mode Composer drops only the root package's `scripts`
* listeners and still dispatches the events to plugin subscribers.
*
* `activate()` captures the {@see Composer} and {@see IOInterface} handed in
* by the host so the event callbacks can reuse them; `deactivate()` and
Expand Down
2 changes: 1 addition & 1 deletion src/Init/InteractiveInitWizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ private function askAutoSync(IOInterface $io, array $defaults): bool

$io->write('<info>4/4 auto-sync</info> — when <comment>true</comment> (default), <comment>skills:update</comment> runs');
$io->write(' automatically after every <comment>composer install</comment> /');
$io->write(' <comment>composer update</comment>. Suppressed by <comment>--no-scripts</comment>.');
$io->write(' <comment>composer update</comment>.');
$bool = $io->askConfirmation(
\sprintf(
' <info>auto-sync</info> [<comment>%s</comment>]: ',
Expand Down
Loading