Skip to content

Commit 95ca8de

Browse files
committed
fix: register installed skills in boost.json during add-skill
When `boost:add-skill` downloads a community skill, it calls `boost:update` to sync skills to agent directories. However, `boost:update` checks `Config::hasSkills()` which reads the `"skills"` key from `boost.json`. If the user never ran `boost:install --skills`, this key doesn't exist, so the sync is silently skipped — the skill sits in `.ai/skills/` but never reaches `.claude/skills/`, `.cursor/skills/`, etc. Fix: register the installed skill names in `boost.json`'s `"skills"` array before calling `boost:update`, ensuring the subsequent sync always runs. Fixes #620
1 parent e11c0d6 commit 95ca8de

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Console/AddSkillCommand.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use InvalidArgumentException;
1313
use Laravel\Boost\Concerns\DisplayHelper;
1414
use Laravel\Boost\Skills\Remote\GitHubRepository;
15+
use Laravel\Boost\Support\Config;
1516
use Laravel\Boost\Skills\Remote\GitHubSkillProvider;
1617
use Laravel\Boost\Skills\Remote\RemoteSkill;
1718
use Laravel\Prompts\Terminal;
@@ -167,6 +168,7 @@ protected function installSkills(): int
167168

168169
grid($results['installedNames']);
169170

171+
$this->registerInstalledSkills($results['installedNames']);
170172
$this->runBoostUpdate();
171173
$this->showOutro();
172174
}
@@ -273,6 +275,23 @@ protected function addSkills(Collection $skills, string $absoluteSkillsPath, boo
273275
return $results;
274276
}
275277

278+
/**
279+
* Register newly installed skill names in boost.json so that
280+
* boost:update knows skills are enabled and syncs them to
281+
* agent-specific directories (.claude/skills/, .cursor/skills/, etc.).
282+
*
283+
* @param array<int, string> $installedNames
284+
*/
285+
protected function registerInstalledSkills(array $installedNames): void
286+
{
287+
$config = app(Config::class);
288+
289+
$existing = $config->getSkills();
290+
$merged = array_values(array_unique(array_merge($existing, $installedNames)));
291+
292+
$config->setSkills($merged);
293+
}
294+
276295
protected function runBoostUpdate(): void
277296
{
278297
$this->callSilently(UpdateCommand::class);

0 commit comments

Comments
 (0)