feat(skills): live refresh from the filesystem#2606
Merged
Conversation
2 tasks
Contributor
Author
This was referenced Jun 11, 2026
|
React Doctor could not complete this scan.
Reviewed by React Doctor for commit |
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
packages/workspace-server/src/services/skills/schemas.ts:82-84
**Exported schema is never used**
`skillsChangedEvent` is defined and exported here but not referenced anywhere else — it doesn't appear in `skills.router.ts` as `.output(skillsChangedEvent)` and no other file imports it. Every other procedure in the router uses an explicit output schema; the `watch` subscription currently carries no runtime validation. Either wire it up with `.output(skillsChangedEvent)` on the procedure, or remove the schema.
Reviews (1): Last reviewed commit: "feat(skills): live refresh from the file..." | Re-trigger Greptile |
jonathanlab
approved these changes
Jun 11, 2026
0b5ff98 to
34baff5
Compare
a0b806d to
1e80286
Compare
34baff5 to
83a4081
Compare
1e80286 to
5df364a
Compare
Contributor
Author
Merge activity
|
83a4081 to
fc872b6
Compare
5df364a to
017c36e
Compare
- SkillsService.watchSkills merges @parcel/watcher streams over ~/.claude/skills (created if missing) and each open workspace folder's .claude/skills into a single debounced "skills changed" event stream. One failing root cannot break the others. - skills.watch tRPC subscription using the async-generator pattern, with the watcher bound alongside SkillsService in skills.module. - useSkillsWatcher subscribes once at the SkillsView boundary and invalidates every skills query on change; the 30s staleTime fallbacks are gone. Generated-By: PostHog Code Task-Id: f4e84f1a-19c9-490c-9b98-47787a7dddcf
…chema Review feedback on #2606: watchSkillDirs now polls directories that do not exist yet (e.g. a repo .claude/skills created after the watch started) and attaches a watcher once they appear; the unused skillsChangedEvent schema is removed (tRPC output validation does not apply to async-generator subscriptions in our version). Generated-By: PostHog Code Task-Id: f4e84f1a-19c9-490c-9b98-47787a7dddcf
017c36e to
5b8c1af
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
Skills loaded in the UI do not reflect external changes made on disk (e.g. edits from a terminal, agent sessions, or another editor) until the page is manually refreshed.
Changes
A
watchSkillsmethod was added toSkillsServicethat watches the writable skill roots (~/.claude/skillsand each repo's.claude/skillsdirectory) usingWatcherService. File system events are debounced (300 ms) and collapsed into a single{ changed: true }event to avoid flooding the UI with updates.A
skills.watchtRPC subscription endpoint was added to the skills router, exposing this stream to the frontend.A
useSkillsWatcherhook was introduced that subscribes toskills.watchand callsqueryClient.invalidateQuerieson all skills queries whenever a change event arrives. This hook is mounted insideSkillsViewso the skills list and file contents stay in sync with disk automatically.The hardcoded
staleTime: 30_000overrides were removed fromuseSkills,useSkillContents, anduseSkillFilesince live invalidation via the watcher makes manual staleness tuning unnecessary.WatcherServiceis now bound inskillsModuleso that hosts loading only the skills module (e.g. Electron main) have the dependency available without requiring a separate binding.How did you test this?
watchSkillDirsintegration test that creates a skill directory on disk after the watcher attaches and asserts that a debounced change event is emitted within 10 seconds.watchSkillDirsfinishes immediately when given an empty directory list.Automatic notifications