feat: Add --fresh for clean skill output rebuilds - #850
Conversation
- Introduced a new `--fresh` option in `InstallCommand` and `UpdateCommand` to clean up output folders by deleteing each of agent's generated skills directories before installation or update. - Updated `SkillWriter` to handle the fresh sync logic, ensuring untracked entries are removed and dangling symlinks are cleaned up. - Added tests to verify the functionality of the fresh sync feature, ensuring it behaves correctly under various scenarios.
Use one symlink deletion path for both top-level and nested skill entries. Windows can require rmdir() for directory symlinks, including dangling links whose targets no longer exist, so nested cleanup must not gate the fallback on is_dir(). Add a regression test for nested dangling symlinks and make the test cleanup helper use the same unlink/rmdir fallback.
|
AI generated review
|
# Conflicts: # src/Console/UpdateCommand.php
Require confirmation unless --force is supplied and reject targets that overlap the canonical custom skills directory.
|
Addressed in e96179c
Focused coverage now includes confirmation and |
# Conflicts: # src/Console/UpdateCommand.php
|
AI-Review: (reviewed at 1. 2. A correctly-scoped 3. Overlap guard is swallowed and the command still exits 0 — 4. 5. Failed deletes are silent — 6. Suggested alternative to /** @return array<int, string> Entries in the skills dir Boost did not write. */
public function untracked(Collection $skills, array $previouslyTrackedSkills = []): array
{
$root = base_path($this->agent->skillsPath());
if (! is_dir($root)) {
return [];
}
$known = array_merge($skills->keys()->all(), $previouslyTrackedSkills);
return array_values(array_diff(scandir($root) ?: [], $known, ['.', '..']));
}To be clear on what I'm not disputing: the underlying annoyance is real and manually |
Adds a
--freshflag toboost:updateandboost:installthat deletes each selected agent’s generated skills directory before running the normal skill sync.Why
We have run into this a few times in real projects: generated skill folders can end up with dangling symlinks, stale files, or broken copied directories after switching between operating systems, resolving merge conflicts, or committing generated agent output by mistake.
The fix was always straightforward: delete the generated skills folder manually, then rerun
boost:updateorboost:install.This flag makes that cleanup an explicit Boost workflow instead of a manual recovery step.
Behavior
When
--freshis passed, Boost removes the generated skills directory for each selected agent before syncing skills again.Default behavior is unchanged unless
--freshis passed..ai/skillsremains untouched.Use case
This is useful when generated agent directories contain files that are no longer part of the current Boost sync result. Without deleting the generated directory first, those stale files can remain present and continue influencing the agent.
Example:
or:
Safety
The source
.ai/skillsdirectory is preserved.Running
boost:updateorboost:installwithout--freshbehaves exactly as before.Tests
Tests cover:
boost:update --freshboost:install --fresh.ai/skillsis preserved--fresh